William James
7/26/2015 6:55:00 PM
Rob Warnock wrote:
> Heh! Funny you should mention. The most successful (so far) of
> my many attempts at coming up with a usable reader macro shorthand
> for LAMBDA provides implicitly-declared parameters with names of
> $1, $2, &c., like a shell script. [The choice of "#$" as the reader
> macro is supposed to be a reminder of that.] It's too ugly and
> non-standard for code you might ever want to release to others,
> but on the other hand it's sometimes kinda convenient if you're
> just messing around interactively:
>
> > (mapcar #$(* $1 3) '(1 8 4 2))
> (3 24 12 6)
Gauche Scheme:
gosh> (map (cut * 3 <>) '(1 8 4 2))
(3 24 12 6)
gosh> (map (pa$ * 3) '(1 8 4 2))
(3 24 12 6)
> > (mapcar #$(cons $2 (1+ $1)) '(1 8 4 2) '(bill joe sally ted))
> ((BILL . 2) (JOE . 9) (SALLY . 5) (TED . 3))
> > (remove-if #$(char= #\L (char (symbol-name $1) 2))
> '(bill joe sally ted))
> (JOE TED)
> >
>
>
> -Rob
>
> p.s. Another flavor I tried, but never found as convenient
> [since you still have to type the whole parameter list] was:
>
> > (mapcar #[(x y) (cons y (1+ x))] '(1 8 4 2) '(bill joe sally ted))
> ((BILL . 2) (JOE . 9) (SALLY . 5) (TED . 3))
gosh> (map (^(x y) (cons y (+ 1 x))) '(1 8 4 2) '(bill joe sally ted))
((bill . 2) (joe . 9) (sally . 5) (ted . 3))
--
As more and more power gravitates in the capital, the more vital it becomes for
the corporate America to secure its interests by corrupting that seat of power.
www.kolumbus.fi/aquilon/america-middle-class-and-the-end-of-growth.htm