glycerine / zygomys

Zygo is a Lisp interpreter written in 100% Go. Central use case: dynamically compose Go struct trees in a zygo script, then invoke compiled Go functions on those trees. Makes Go reflection easy.
https://github.com/glycerine/zygomys/wiki
BSD 2-Clause "Simplified" License
1.71k stars 81 forks source link

[Feature request] Unsigned integers #39

Closed japanoise closed 5 years ago

japanoise commented 5 years ago

I'd like to use Zygomys for my assembler project. I notice that it's documented to only use signed int64s; it'd be useful if I could use unsigned integers in some way, preferably as uint64s.

glycerine commented 5 years ago

Sure; this isn't too difficult. Just add an SexpUint64 to match the SexpInt everywhere; see https://github.com/glycerine/zygomys/blob/master/zygo/expressions.go#L72 for the definition of SexpInt.

You'll need to add this yourself. But I'm happy to review and merge a PR. You'll need a testfile under tests/uint.zy.

glycerine commented 5 years ago

@japanoise The latest releases, v5.0.9 and v5.1.0, have uint64 support. See the tests/uint64.zy file for examples. ( https://github.com/glycerine/zygomys/blob/master/tests/uint64.zy )

Try this out and let me know if there's anything significant missing to make it usable.

glycerine commented 5 years ago

Closing this as now implemented. Feel free to open a new issue for any refinements.

japanoise commented 5 years ago

Thank you for the quick turnaround!