I've been reconstructing an old programming language. It originally had a very simple but awkward macro facility: if an identifier was declared as a macro, whenever it was called, it could inspect/consume as much of the remaining tokens as it wished and could splice other tokens in. On top of this a very nice "declarative" macro system was built, which I loved when I used it. Since my implementation is not yet self-hosting, I've been using higher-order functions instead, and the more I do this the less I want macros. You could think of the rewrite rules in VisualWorks as something resembling macros. Come to think of it, Lukas Renggli, Helvetia, ... found it! http://scg.unibe.ch/archive/phd/renggli-phd.pdf On 12 June 2018 at 12:10, Michael Forster <mike@forsterfamily.ca> wrote:
On Fri, May 25, 2018 at 10:12 AM, Ben Coman <btc@openinworld.com> wrote:
On 25 May 2018 at 21:22, Debiller 777 <ozovozovozo202@gmail.com> wrote:
Well, I've already asked about adding new literals to pharo or Smalltalk in general, however this time I have a better idea: macros. Can they be added? Because if I understand correctly they may be the only way to do that.
Can you provide an example how how you would use a macro?
cheers -ben
Late to the party, but I thought some might find it interesting to look through the "macros vs. blocks" thread on the old Lightweight Languages mailing list. Posts from Guy Steele Jr., Avi Bryant, Trevor Blackwell (rewrote Graham's Yahoo Store in Smalltalk), and others:
https://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg02060.html
Cheers,
Mike