jathak / dart_scheme

Online Scheme interpreter, formerly for 61A
https://scheme.jenthakar.com
BSD 3-Clause "New" or "Revised" License
45 stars 5 forks source link

Forcing a non-listy value should not result in a value being cached #91

Open kavigupta opened 5 years ago

kavigupta commented 5 years ago

It should work exactly like error.

scm> (define x (delay (begin (print 2) (/ 1 0))))
scm> (force x)
2
Error
scm> (force x)
2
Error

but right now it seems to cache the value and not re-evaluate it

scm> (define x (delay (begin (print 2) 0)))
scm> (force x)
2
Error
scm> (force x)
Error