3 ms·
> If there were some better known examples of what lisp macros were good for If there were better examples of what oscilloscopes are good for, every home would
by kazinator 9y ago
> If there were some better known examples of what lisp macros were good for
If there were better examples of what oscilloscopes are good for, every home would have one.
Macros are a tools for programming the programming language, which makes them somewhat specialized.
Good examples of macros are the ones which already exist; they are there for anyone to study: for instance the macros of the Common Lisp object system, the Common Lisp LOOP macro and such.
> questionable compared to natural human scripts
No successful, mainstream programming language follows human scripts.
Even though human scripts appear linear, just laying words down in order, the underlying syntax is anything but linear.
The syntax is very difficult and full of ambiguities that need a great deal of advanced semantic context to unravel. It is a poor model for designing programming languages.
Programming languages designed to imitate natural language
and scripts have been failures at best, and programmer laughing stocks at worst.
> none of them work from inside to out.
Most common, mainstream programming languages have expressions that work from inside out and so does math notation.
C: { memcpy(get_address(x, y), z, get_size(x, y)); }
Shell: FOO=$(basename "$(command x y)")/bar
GNU Make: $(foreach F,$(SOURCES),$(addprefix foo/,$(F)))
XML: <foo><bar>datum</bar></foo>
> eg, Chinese
Chinese characters, though, are built from radicals and components in a process that can is basically basically inside out. The elements can stack left-right or up-down, or be fully or partially enclosed, in what amounts to de facto a recursive generative process.
See this famous, fairly complicated character:
https://en.wikipedia.org/wiki/File:Bi%C3%A1ng.svg https://en.wikipedia.org/wiki/File:Bi%C3%A1ng.svg