;
; regex ::= a Lisp string
-;;; Regular expressions can be created by using the `REGEX' form. The
-;;; regex form actually does nothing at all to its argument, and
-;;; prints it as is.
+;;; Regular expressions can be created by using the `REGEX' form. If
+;;; the argument does not start with a slash, it is surrounded by
+;;; slashes to make it a proper JavaScript regex. If the argument
+;;; starts with a slash it is left as it is. This makes it possible
+;;; to use modifiers such as slash-i (case-insensitive) or
+;;; slash-g (match-globally (all)).
+
+(regex "foobar") => /foobar/
(regex "/foobar/i") => /foobar/i
tmpI2 = tmpI2 + 1) {
var l = tmpArr1[tmpI2];
document.write('L is ' + l);
- }
+ };
}
;;;t \index{scoping}
;;;t \index{closure}
-; (WITH (object) body)
+; (WITH object body)
;
; object ::= a ParenScript expression evaluating to an object
; body ::= a list of ParenScript statements
;;; adds the object `object' as an intermediary scope objects when
;;; executing the body.
-(with ((create :foo "foo" :i "i"))
+(with (create :foo "foo" :i "i")
(alert (+ "i is now intermediary scoped: " i)))
=> with ({ foo : 'foo',
i : 'i' }) {