I wanted to make a scheme interpreter,but then quickly found out that there were too much syntactic sugar/salt.
Luckily we are on Snap which doesn't need that much syntactic sugar/salt
(i only know the list block which is a sugar that removes the need of consing)
Someone tell me how to make it?
(i am working on a version without syntactic sugar/salt,i.e only cons for you )
i don't think a while loop makes sense, because true would just repeat forever. while loops take a predicate, generally not just a boolean.
it would almost certianly be better represented with IF, which happens to be the same as the church numerals 0 and 1 (that's a guess based on your comment, i can't be bothered to actually check what church numerals are exactly)
my point is that it would get stuck and nothing useful could be done after that, unless you put all the logic in it. there's no benefit to having it run more than once.
either that, or your description isn't accurate
" " inducing parser
i mean that the syntax has too much suger in it and i dont want to parse this much possiblilities of an expression
Yeah (i have already made it and the topic is on my drafts list)
I actually have already made the (half-hearted) parser,and if you just call "gobble leftovers" it would do what you are expecting.(although slightly different,the parameters should be in one list so its like this
I don't understand this... oh wait, do you mean how do you make a predicate? Because your point about while loops is that the predicate has to be invoked each time through the loop? I don't think there is a WHILE primitive in Scheme, but if there is one, and if it's a special form, then you have to wrap a lambda around the predicate expression. In Scheme it's just (lambda () ...). If you wanted to do it in true lambda calculus where every function has exactly one input, you'd generate a variable that's not used in the body.
What do you mean? The parentheses tell you what goes with what, unambiguously, no special cases. That's why I suggested just starting with the lists already created, then come back to the listification (the reader, as we say in lispland) after everything else is done.
The core of an evaluator consists of two procedures, EVAL and APPLY. This is what Chapter 4 is about, but here's a simple version:
Are you trying to make an self interpreter?
Anyways,if you hasn't seen it,i had made a working one but without builtin functions(with apply,lambda,and var tho)Snap! Build Your Own Blocks