« Maintainance programming | Main | lists coming from methods »

October 21, 2004

problem with quoted lists

CX has an issue with any function that contains a list inside the quote. In other words, quoted lists don't work.

set["x" {+[2 c]}]

This is the peice of code I'll be referring to for now on. The problem is that when the list [2 c] is read, the 'c' is evaluated on the spot! when we run 'x', the interpreter attempts to add 2 to null, because at the time of the creation of the list [2 c], c was not linked to anything. My best solution is to do 2 things:

first, I need to seperate lists from quotes. I'm going to subclass Stack.java into CXList and CXQuote. The next step is to have quoting levels for the parser; every '{' character will raise the quoting level, and every '}' will lower it. The quoting level starts at 0, so when it is at 0, lists are evaluated on the spot. If the quoting level is above zero, lists are created as CXList's, where the values in the list are going to be evaluated later. Once this is done, I'll clean up the code and make this newest release 0.36 Alpha. When conditions are done, it'll be 0.36.

here is a demonstation of a function working becuase it has no list in the quotation

Posted by Rex at October 21, 2004 08:11 AM

Comments

Post a comment




Remember Me?