masak / bel

An interpreter for Bel, Paul Graham's Lisp language
GNU General Public License v3.0
26 stars 1 forks source link

Explore implementing Common Lisp's DEFPARAMETER #417

Open masak opened 2 years ago

masak commented 2 years ago

This one: defparameter.

Inspiration comes from reading Norvig's PAIP, where he makes good use of parameters.

These are not exactly like Bel's dynamic variables; in particular (as you can see an example of in the Hyperspec node) there's a nice story for dynamically overriding parameters in a function signature. I remember re-discovering the same trick independently in Raku years ago.

This should be possible by (a) hacking the Perl implementation to support parameters, and then (b) hacking the bel.bel evaluator to do the same. I look forward to the day when doing the latter is easy, because we're standing inside the metacircle.