Klaas-Jan Stol wrote:
[snip]Hello,
I've been playing with closures and subs but I have a little bit of trouble with those.
I'm a bit confused by all different flavours of syntax, I've been trying to read and understand all documents concerning this subject, the most useful was reading the test scripts. However, that is PASM, and I like PIR better :-).
A general question is: what syntax should one use in what context?
(I understand that PCC should be used whenever one wants to interact with other languages. Also, calling functions can be done in many ways)
A more specific question is this:
I'm trying to create a closure, and I think I've implemented this code (it's lua code, but I'm not sure if it's 100% correct,
anyway, I'm trying to get a feeling for how one should translate this). So, actually I have 2 questions;
(1): did I translate the function below correctly (I think the Lua syntax won't be a problem, it's quite straightforward).
(2): what is causing my strange result (see below).
# foo(q) .arg q $P0()
Try this instead:
$P0(q)
- Sam Ruby