Pat
Not every implementation supports the square brackets. Parentheses are
standard.
If you still want to use square brackets, the places where they're used
commonly is where many nested parens hinder readability:
(let-values ([(x y) (foo baz)]
[(t q r) (values 1 2 3)])
...)
(letrec ([id (lambda (x) x)]
[f
(lambda (x)
(id f))])
...)
and so on. Or to group clauses:
(cond
[test expr]
[(pred? x) foo]
[else ...])
(case foo
[(a b c) 'a-or-b-or-c]
[else 'neither])
(syntax-rules ()
[(_ x) (foo x)]
[(_ x y) (bar x)])
(case-lambda ; if your system has it
[(x y) (cons x y)]
[(x y z) (vector x y z)]
[rest rest])
Aziz,,,
> If you still want to use square brackets, the places where they're
> used commonly is where many nested parens hinder readability:
That's highly subjective, though. I find Scheme source interspersed
with [] much harder to read than without.
mkb.
Not at all. Standard is '(' and ')'. Other parentheses are added
to improve readability. However I personally have a harder time
reading sources with multiple types of parentheses.
--
Hans