Arc Forumnew | comments | leaders | submitlogin
6 points by almkglor 6131 days ago | link | parent

macros override functions everywhere. Try doing something like this:

  (let obj (table)
      (obj 1))
Since obj is a newly-initialized table, we expect (obj 1) to return nil - except (obj ...) is a macro, which overrides the intended definition.

Basically, your greatest risk is that someone will define a new macro in Arc, which happens to shadow a variable (regardless of locality) you are already using in existing code. If that variable is a variable for a collection, you are s.c.r.e.w.e.d.

Maybe we should require that macro names have some defining feature?



4 points by andreuri2000 6131 days ago | link

Hmm, so one gets:

   (let f  1 f)              ==> 1
   (let do 1 do)             ==> 1
   (let f  (fn () 1) f)      ==> #<procedure:f>
   (let do (fn () 1) do)     ==> #<procedure:do>
   (let f   (fn () 1) (f))   ==> 1
   (let do  (fn () 1) (do))  ==> nil    
Seems pretty screwed up to me...

-----

4 points by almkglor 6131 days ago | link

Yes. It might be a good idea to separate macro namespaces from normal namespaces.

-----