« problem with quoted lists | Main | quoted lists »

October 24, 2004

lists coming from methods

I have functions with lists working! Oh the joy, but not THAT much joy yet. Now I have 2 more problems, similar.

Every function returns a list! Do you know how uncool that is? it started out when I first made CX. Don't worry, the codebase is not big enough for that fact to mean much. When I first made CX, I made it so that you could evaluate two expressions at once, seperated by nothing. "hi" "there" would return 'hi there', and this was how your expression was evaluated into more than one result. When I build upon this, I did enough factoring where this same 'idea' is implemented in quotes:

set["x" {twice twice 3 twice 3}]

x => [12 , 6]

Now, thats coolish, but if the function of x was just 'twice twice 3', it would return [12], which is a list holding one number. It's not the number itself!

set["x" {twice twice y}]
set["y" {*[3 4]}]

x => ERROR: twice: input was not a single number.

twice recieved a list of one number, not the number itself! To fix this, I need to make it so that typing "hi" "there" only returns "there". Lispy, huh? Yah, don't spit on me anymore. If you want to evaluated more than one thing at once, do [ "hi" "there" ]. I also need to change most of the LinkedLists to be my own CXList classes because LinkedList.toString has comma seperated slots and I need spaces. Anyway, once those small things are done,

x => 144

Once that is done, the sacred 'inp' word will be implemented for user-defined functions that use application rather than concatenation.

Posted by Rex at October 24, 2004 05:49 PM

Comments

Post a comment




Remember Me?