Re: Paul Graham's Arc is released today... what is the long term impact?



[Hope I've untangled/attributed the quotes correctly...]

John Thingstad <jpthing@xxxxxxxxx> wrote:
+---------------
| > "John Thingstad" <jpthing@xxxxxxxxx> writes:
| >> But following Rob Warnock's £ readmacro syntax idea.
|
| Typo: should be $ readmacro.
+---------------

Actually, should be #$ readmacro. It's too minor to eat all of $.

Kent M Pitman <pitman@xxxxxxxxxxx>:
+---------------
| > (mapcar λ(format "~A:~A" λ1 λ2) list)
| Here, by contrast, I see lambdas.
+---------------

I don't, I just see weird two- or three- characters sequences.
Must be some UTF-8 or ISO-8859 thingies I can't see.

But here's a really twisted one for those with "dumb" terminals:
Instead of using FN to abbreviate LAMBDA, we can use /. which
kinda looks like a lambda is you squint: ;-}

> (defmacro /. (args &body body) `(lambda ,args ,@body))

/.
> (mapcar (/. (x) (* 3 x)) (iota 5))

(0 3 6 9 12)
>

Kent M Pitman <pitman@xxxxxxxxxxx> asked:
+---------------
| But I'm curious: how does the nesting of this macro work? What does
| (lambda (x)
| (lambda (y z)
| (f x y z)))
| look like in this shorthand format?
+---------------

With /. it's easy:

(/. (x)
(/. (y z)
(f x y z)))

but of course with #$ you can't do it without introducing
a renaming variable [just like with nested shell functions]:

#$(let ((x $1))
#$(f x $1 $2))

But how often do you need to type that at the REPL? ...which is
where #$ was intended to be used, *NOT EVER* in coding source files!


-Rob

-----
Rob Warnock <rpw3@xxxxxxxx>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607

.



Relevant Pages

  • Re: Minimal keywords needed for constructing a full CL system
    ... The one puzzle that baffled me relentlessly at the time, ... It seemed weird and unsatisfying to say that LAMBDA and AREF were ... turned out to be the same one that Kent came to. ... I'm not disputing that assertion, but here's an example of a paper ...
    (comp.lang.lisp)
  • Re: Minimal keywords needed for constructing a full CL system
    ... The one puzzle that baffled me relentlessly at the time, ... was array reference. ... It seemed weird and unsatisfying to say that LAMBDA and AREF were ... turned out to be the same one that Kent came to. ...
    (comp.lang.lisp)

Loading