Re: How powerful macros are?

From: Marco Antoniotti (marcoxa_at_cs.nyu.edu)
Date: 03/23/05


Date: Wed, 23 Mar 2005 16:21:16 -0500


V.Ch. wrote:
> Currently my knowledge of macros (and Lisp as a whole) is extremely
> superficial, so forgive me if it's a silly question, but... Can I use
> macros to make
>
> (setf (aref a 12) 13)
>
> look something more like
>
> a[12] = 13?

Yes you can. Look at the INFIX package in the CMU AI.Repository.

However, first it does not mean that you want to do it, second you'd
better ask the question: cai I use other macro systems to make C++ or
Java or Perl

        a[12] = 42;

look like

        (setf (aref a 12) 42)

?

>
> I've started playing with List just few weeks ago. I think I got used to
> somewhat weired loops, branching, etc; but using arrays, and in
> particular, assigning to arrays, seems clumsy enough to be a show-stopper.

You have a very low tolerance. How are you going to ever learn the
basics of APL? Or INTERCAL?

Cheers

--
Marco


Relevant Pages

  • Re: How powerful macros are?
    ... > superficial, so forgive me if it's a silly question, but... ... > macros to make ... You can persuade the Lisp reader to do this. ... > to somewhat weired loops, branching, etc; but using arrays, and in ...
    (comp.lang.lisp)
  • Re: How powerful macros are?
    ... > superficial, so forgive me if it's a silly question, but... ... > macros to make ... > to somewhat weired loops, branching, etc; but using arrays, and in ... Lisp is not for you. ...
    (comp.lang.lisp)
  • How powerful macros are?
    ... Currently my knowledge of macros (and Lisp as a whole) is extremely ... superficial, so forgive me if it's a silly question, but... ... particular, assigning to arrays, seems clumsy enough to be a show-stopper. ...
    (comp.lang.lisp)
  • Re: Macro list drop down
    ... noticed that the way macros are listed makes no sense at all. ... the template, sometimes not. ... It's not a silly question at all. ...
    (microsoft.public.word.vba.general)
  • Re: New book about Common Lisp: Let Over Lambda
    ... I have read every lisp book I've been able to get my hands on ... Lisp macros are not given nearly enough ... I personally consider Let Over Lambda to be an unofficial sequel ... integral parts of the language. ...
    (comp.lang.lisp)