Arc Forumnew | comments | leaders | submitlogin
2 points by kennytilton 6137 days ago | link | parent

Coolio. Any way around seeing * redefining % each time?


1 point by parenthesis 6137 days ago | link

Ah, yes, that's what I forgot to say: I also changed in arc.arc :

  (set safeset (annotate 'mac
                 (fn (var val)
                   `(do (if (bound ',var)
                            (if (~is ',var '%)
                                (do (disp "*** redefining ")
                                    (disp ',var)
                                    (writec #\newline))))
                        (set ,var ,val)))))

-----

1 point by sjs 6137 days ago | link

I changed it to:

    (tostring (mac % () expandedexpr))

-----

1 point by parenthesis 6137 days ago | link

Why does that work?

-----

2 points by sjs 6137 days ago | link

tostring captures whatever is sent to stdout.

    (tostring (prn "hi"))
returns the string "hi\n" instead of actually printing it.

-----