...So, what does lisp excel at? What could be better? [besides the ((+ 1 2)) syntax.. // it's gone ;]
Also, just any comments / suggestions ? Bad idea to implement a scripted interpreter on top of an interpreted language? (probably why lisp dies..?)
er, loading scripts is going to be a pain... but once loaded up not so bad / only mod-able ones need to be loaded.. static scripts being (probably heaps) faster
the heart needs to be an eval call + soft-code stack.. dynamic loops (changing inner loop code inside/executing that loop) probably not impossible, maybe even necessary at times..? (cringe)
come on lispers... there must be a good way to do dynamic loops..
static ones are as simple as appending a string, eg. eval('for(iter=1:10); fprintf("aa\n"); endfor;');
>>1
"modifying running code" is just a matter of calling eval.
>>7
Sorry. I dont know what are "dynamic loops" and I'm messing with Symta. So here is how new Symta:
point X Y = <x = X
;y = Y
;metric = X^2+Y^2 sqrt
;`+` P = point P.x+X P.y+Y
>
compares to C/C++:
class point {
private:
int X;
int Y;
public:
point (int XX, int YY) { X=XX; Y=YY; }
int x () { return X; }
int y () { return Y; }
metric () { return sqrt(X^2+Y^2); }
point operator + (P) { return pow(P.x(),2)+pow(P.y(),2); }
};
and these lowercase letters would be now just syms, so <X.odd=say X is odd; X.even=say X is even> would work
So, say i'm on the first iter of a loop, should the current iter be mod-able? or only the next? What if i want to mod the third iter from the first? Store on the first, and modify on the second?
>>10 looks interesting.. your using < and > like { and } ?, with semicolon still breaking up lines of code..?
A dynamic loop might start off being
for(iter = 1:10)
i++;
endfor;
for one (the first) iter, but then with the right inner loop code, may change into something else entirely... or that's the basic idea anyway
Name:
Anonymous2013-02-18 0:06
>>16
How is a dynamic loop different from using a mutable closure as the predicate?
Name:
Anonymous2013-02-18 0:07
>>16 semicolon still breaking up lines of code..?
No. They separate method declarations.
>>16 may change into something else entirely... or that's the basic idea anyway
I dont get it. Just use continuations or something, if you want to change loop.
>>21 yeh i'm not sure.. lisp programs are supposed to be lists themselves, so inserting an instruction like that should be more or less trivial (in lisp).. I think i'll just have to think some more =)