← Back to context

Comment by swatson741

7 days ago

You'll still probably need the `strcmp` because the pointers won't be the same unless you check for them and make them the same.

You may be thinking about how `eq?` (reference equality) works in scheme. That's usually done by hashing the identifier string. Which is the more general solution to this equality problem.

The atoms strcmp()ed by the interpreter are all created by the compiler so you can ensure the pointers are equal by construction.

  • You're right `virtmach` only works on things that are output from `compile` and maintaining the invariant that virtmach lisp uses those pointers isn't difficult to do in with how the evaluator is presented.

    It gives virtmach lisp and scheme different ontology, but I can't think of any practical reason why that would matter other than it makes things a little bit more complicated. But, then again if I'm thinking practically scheme should be using hashed identifiers, and then there's no reason for them to have different ontology and conceptually we're right back where we started with virtmach lisp and scheme using identifiers as objects.