azhenley / hofstadter Goto Github PK
View Code? Open in Web Editor NEWAn esoteric programming language that supports concurrency, regex, and web requests.
License: MIT License
An esoteric programming language that supports concurrency, regex, and web requests.
License: MIT License
Lines 38 to 41 in 1c30c61
In the above lines from the interpreter, the symbol for console io is denoted by #
. Either the documentation should be updated to reflect that or the interpreter should be updated to be consistent with the documentation.
Error:
Traceback (most recent call last):
File "/home/cade/programs/hofstadter/hofstadter.py", line 221, in <module>
evaluator = Evaluator([Line(x) for x in rawlines])
File "/home/cade/programs/hofstadter/hofstadter.py", line 221, in <listcomp>
evaluator = Evaluator([Line(x) for x in rawlines])
File "/home/cade/programs/hofstadter/hofstadter.py", line 17, in __init__
self.tokenize()
File "/home/cade/programs/hofstadter/hofstadter.py", line 23, in tokenize
t = self.nextToken()
File "/home/cade/programs/hofstadter/hofstadter.py", line 76, in nextToken
while not self.text[self.index].isspace() or escaped and self.index < length:
IndexError: string index out of range
https://github.com/AZHenley/hofstadter/blob/main/hofstadter.py#L76 has the conditional checks out of order, it change from:
while not self.text[self.index].isspace() or escaped and self.index < length:
to:
while self.index < length and not self.text[self.index].isspace() or escaped:
Most useful programs written in hofstadter will likely need some setup and cleanup utilities -- adding a __name__
check would allow for programmers to 'elegantly' import hofstadter into a python script which encompasses setup, execution, and cleanup.
In the documentation, it is stated that ;
represents the Console IO character. In the source code, hofstader.py
lines 39-41 tokenize #
as the "stdin/stdout" token. As such, current evaluation computes ;
as a filename. Either the documentation should be updated to reflect that #
is the appropriate operator, or the code should be changed to evaluate ;
as the console operator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.