This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: mbstrings


Jim Blandy <jimb@red-bean.com> writes:

>   ;; Precompile these regexps.  Perl would do this automatically.  *pout*
>   (let ((line-regexp
> 	 (make-regexp "^0x([0-9A-Z]+)\t0x([0-9A-Z]+)\t0x([0-9A-Z]+)"))
> 	(comment-regexp
> 	 (make-regexp "^[ \t]*#")))

But of /course/ Guile can do it automatically, too. :) Observe:

(defmacro make-precompiled-regexp (reg)
  (if (string? reg)
      (make-regexp reg)
      `(make-regexp ,reg)))

-- 
I refuse to use .sig