Re: sharp-back syntax



<nallen05@xxxxxxxxx> wrote:
+---------------
| I hate having to type l-a-m-b-d-a over and over again...
| luckily it's easy to add syntax to Lisp:
....
| #`(= ?x 5) => (lambda (?x) (= ?x 5)) ...
| (mapcar #`(> ?x ?y) list1 list2) => ...
+---------------

Yeah, I think we've all done something similar. Myself,
I called it #$ and used shell-like ${digit} as params:

> (mapcar #$(= $1 5) '(1 3 5 7 9))

(NIL NIL T NIL NIL)
> (mapcar #$(* $1 1.085) '(12.34 15 10 25.37))

(13.3889 16.275 10.85 27.52645)
> (mapcar #$(> $1 $2) '(1 2 3 4 5) '(5 4 3 2 1))

(NIL NIL NIL T T)
> (mapcar #$$2 '(1 2 3) '(4 5 6) '(7 8 9))

(4 5 6)
>

But I use this *only* at the REPL when poking around,
*never* in saved source files...


-Rob

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


.



Relevant Pages

  • Re: Lisp version of a Cism
    ... > on C", but because of the fundamental differences between C and Lisp, ... (loop for ch = (read-char t nil nil) ... more direct solution in Lisp? ... read characters, ...
    (comp.lang.lisp)
  • Re: Pascal family of languages is getting crowded :-)
    ... > object,> and how this makes it a very powerful language with a very ... Yeah, Lisp was equally ingenious, but with an ugly syntax. ...
    (borland.public.delphi.non-technical)
  • Re: Why dont people like lisp?
    ... > that code is not easily readable because of deep nesting. ... matter of becoming accustomed to the language. ... Most Lisp code I see seems to be ... > (values nil nil) ...
    (comp.lang.lisp)
  • Re: sharp-back syntax
    ... Yeah, I think we've all done something similar. ... (NIL NIL T NIL NIL) ... and make them into lambda varables for the outer one. ... format as your implicit lambda variables, ...
    (comp.lang.lisp)
  • Lisp has more than List Processing (was Re: Vaporware: metaduel simulator)
    ... LISP (only lists as data structure) and ML ... #2A((NIL NIL NIL NIL) ...
    (rec.games.roguelike.development)