[bese-devel] parenscript regexps

Henrik Hjelte henrik at evahjelte.com
Tue Jul 11 14:18:44 UTC 2006


My reply one month later...

On Tue, 2006-06-13 at 14:53 +0000, Lou Vanek wrote:
> ;; Maybe this makes more sense?
> 
> (defun first-slash-p (string)
>    (and (> (length string) 0)
>         (eq (char string 0) '#\/)))
> 
> (defmethod js-to-strings ((regex regex) start-pos)
>    (declare (ignore start-pos))
>    (let ((slash (if (first-slash-p (value regex)) nil "/")))
>      (list (format nil (concatenate 'string slash "~A" slash) (value
> regex)))))
> 
> Lou Vanek 

On Tue, 2006-06-13 at 20:01 +0200, Marijn Haverbeke wrote:
> On 6/13/06, Attila Lendvai <attila.lendvai at gmail.com> wrote:
>         > So think the UCW version shouldn't do that either. Simply a
>         matter of
>         > changing
>         >
>         > (defmethod js-to-strings ((regex regex) start-pos)
>         >   (declare (ignore start-pos))
>         >   (list (format nil "/~A/" (value regex)))) 
>         
>         or maybe changing the manual... that noone cared about much
>         because
>         you have the code that sais it all (at least about the nifty
>         details
>         like this).

Actually parenscript is one of few projects where the manual can be
trusted almost as much as the code. Or it could be that way if everyone
that makes syntax changes to parenscript updates the reference.lisp file
in the docs directory. From this file the pdf documentation can be
generated, and testcases for the syntax (reference-tests.lisp)
The autogenerated testcases makes it easy to hack parenscript while
being sure that nothing breaks. If stuff gets added that is not in the
documentation and not in the tests, it will be more difficult to
maintain parenscript. As in this case, when the documentation was not
updated when the first syntax change to regex was introduced. 

> 
> 
> Well - that will not solve the problem of not being able to add
> options after the second slash. I guess Lou's idea works best. 
I also vote for Lou's idea, since it enables the full power of
javascript again. Three votes for and one against counts as a for, so I
checked it in.

/Henrik Hjelte





More information about the bese-devel mailing list