skx / yal

Yet another lisp interpreter
GNU General Public License v2.0
16 stars 0 forks source link

hashes are implemented oddly #95

Closed skx closed 1 year ago

skx commented 1 year ago

When a hash is created we populate the keys as expected, but we set the value to "readExpression..".

i.e. Hash values are not evaluated at creation time. Instead when a hash is returned as an object, via "eval" the values are evaluated then.

At the time this made sense because readExpression doesn't have access to the environment, nor does it keep track of the state of macros.

The code as-is is fine, but it requires evaluations when arrays are passed around which is gonna slow things down.