0 Members and 3 Guests are viewing this topic.
So how do you plan to distinguish lists from block braces? The primary reason we decided to go with the begin/end instead of { } was due to confusion and potential conflicts.
@exportfunction hello() { local a,b = 1,2 a,b = b,a print(a+" "+b)}
#pragma mode( separator(.,;) integer(h32) )hello();EXPORT hello()BEGIN LOCAL a:=1; LOCAL b:=2; LOCAL %TMP2:=b; LOCAL %TMP3:=a; a:=%TMP2; b:=%TMP3; print(a+" "+b);END;
Quote from: timwessman on October 20, 2014, 09:01:53 amSo how do you plan to distinguish lists from block braces? The primary reason we decided to go with the begin/end instead of { } was due to confusion and potential conflicts.In Source, lists use [] instead. A deviance from the HPPL, sure, but one that works.Even if I make {} the list delimiters, I believe my parsing system could handle it given some slight changes.
Vectors?
Glad to see more optimizing being done . Now if only ASM/C was possible on the Prime so that such program could be compiled directly on-calc or even in actual ASM code. In its current form it's still promising, though, especially considering how fast HP PPL is.
Oh yeah I meant if somebody made the stuff required to run native code. It's possible but the question is if anybody will ever bother, considering how powerful HP PPL already is. You can already have SNES-like graphics without much slowdowns and even 3D polygons now, so if somebody decides to make a game in native code then it will most likely be a port of Doom or emulators.And yeah glad you added If/while lol, but again I once made a game on a calculator that lacks While/For/Repeat so I guess they're not that essential, after all. (I had to use Lbl, Goto, IS>() and DS<())
As for Gotos I'm not a big fan of them anymore since they often cause memory leaks in certain languages or are slower, but they can be handy in some cases if you use and name them properly.
A Java exception has occured
@exportfunction hello() { @inline local x="Source" print("Hello, "+x)}
#pragma mode( separator(.,;) integer(h32) )hello();EXPORT hello()BEGIN print("Hello, "+"Source");END;
@exportfunction test() { @inline local end=10 local a,i=range(1,end),1 while i<=end { print(a[i]) a[i]*=2 i+=1 } print(a)}
function list.test(a as list) { local i = a.size() print("The list is "~i~" elements long.") while i>0 { print("Element "~i~" contains "~a[i]~".") i-=1 } print("Interesting!")}@exportfunction main() { local l as list = range(1,10) l.test()}