3 ms·
In e.g. the Algol example, it seems like you just get a function which can accept an Algol program as a string and run it. Seems quite different from what's bee
by henryaj 5y ago
In e.g. the Algol example, it seems like you just get a function which can accept an Algol program as a string and run it. Seems quite different from what's been done in this case.
- gopiandcode 5y agoI think the process is exactly the same as the ruby example, except for the fact that while in ruby it was a hack, in racket, a programming-language programming language, is explicitly designed to allow for this kind of process. The linked website just mentions that the algol60 package also provides additional functions that allow executing over strings. The default mode of usage is to place a "#lang algol60" at the start of your files, and that configures the lexer/parser to allow the rest of the file to be parsed and interpreted as ALGOL code (just check out the examples in the packages's git forge page).
- dwohnitmok 5y agoYeah. Here's an example. It's exactly the same as any other Algol file except for the lang declaration at the top. https://github.com/racket/algol60/blob/master/examples/nqueen.a60 https://github.com/racket/algol60/blob/master/examples/nquee...