lisp - Parsing s-expressions in Go -


here's link lis.py if you're unfamiliar: http://norvig.com/lispy.html

i'm trying implement tiny lisp interpreter in go. i've been inspired peter norvig's lis.py lisp implementation in python.

my problem can't think of single efficient way parse s-expressions. had thought of counter increment 1 when see's "(" , decrement when sees ")". way when counter 0 know you've got complete expression.

but problem means have loop every single expression make interpreter incredibly slow large program.

any alternative ideas great because can't think of better way.

there s-expression parser implemented in go @ rosetta code:

s-expression parser in go

it might give idea of how attack problem.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -