10 minutes ago, Shriram Krishnamurthi wrote:
> I'm confused. Why aren't $1, etc. also identifiers?
Both are.
> > (define $1 1)
> > (define 50-cent (/ $1 2))
> > 50-cent ;; which, as you know, is pronounced "fiffy"
> 0.5
>
> Or are you asking, "Since I'm going to steal part of the identifier
>
I'm confused. Why aren't $1, etc. also identifiers?
> (define $1 1)
> (define 50-cent (/ $1 2))
> 50-cent ;; which, as you know, is pronounced "fiffy"
0.5
Or are you asking, "Since I'm going to steal part of the identifier
namespace anyway, would you prefer..."? (If so I'd say just take both
a
In XREPL, I followed the CL convention for "identifiers" that evaluate
to past results: ^, ^^, ^^^, etc. CL uses *, which won't work in
Racket.
Another alternative is what Guile does, use a number instead: $1, $2,
$3, etc.
Any opinions or personal preference in favor of one or the other?
--
3 matches
Mail list logo