>
>
>    - "Parser : Refinement of tokens 'subclass' attribute": unfortunately,
>    I was not able to get to see this. I defined (Windows) RXTRACE_PARSING=ON,
>    but unfortunately it seems that no dumping of the clauses and tokens take
>    place.
>
>
ah yes, you need the debug version of ooRexx, does not work with the
dropbox delivery.
Under Windows, the output is sent to the debug output.
If needed, download DebugView (Microsoft Sysinternals).
You may want to limit the output to the parsing :
>From DebugView, Edit/Filter : Include = (Parsing)


>
>    - "Parser : = ==": not sure what the problem is and what changes you
>    implemented. What behaviour is systematically changed here?
>
> In fact, only "==" is impacted. The goal is to support pure expressions
like in select below. The second line is not supported by the current
delivery in dropbox, the change is not yet committed. So you can see by
yourself what happens if you run the second line.

.array~of(1,2,1)~pipe(.select {value==1} | .console)
.environment~pipe(.select {index~left(1) == "S"} | .console)


   - "Parser : Message term": interesting idea, not sure whether really
   needed (looks a bit awkward: sending a message to an object, but not giving
   that message an explicit name; one all of a sudden must remember such a
   short-cut to become able to understand/read code employing it; *however*, I
   would prefer ".yield~()" to ".yield[]" which looks even more awkward,
   although this is possible already with ooRexx).

Most of the languages which support anonymous functions let call them like
named functions, when stored in a variable. In ooRexx, a function call is
f(), but we can't do that :
f = {return 1}
say f()    -- calls the function "f", not the value of the variable f

Hence the ~(), anonymous message.


[now a long digression about yield]

For yield, I had to re-read my notes to remember why I use this notation,
and why I don't use a routine : it's because when a routine is called as a
function, a result is mandatory. Of course, I can use the call notation if
I don't want to use the returned value.

Assuming I add this definition to coactivity.cls :
::routine yield public
    .Coactivity~sendWith("yield", arg(1, "a"))
    if var("result") then return result

Then I can write that :

c={::coactivity yield(1) ; yield(2)}
c~()=    -- [1]
c~()=    -- error No data returned from function "YIELD"

The method ~yield returns the array of arguments passed to c~() which
forwards to ~do which forwards to ~resume.
With one exception : if the array has 0 item then no result is returned by
~yield.
Can't remember why I don't return an empty array, maybe to rework.
Hence the error No data returned...

I have to call yield to avoid the error :
c={::coactivity call yield(1) ; call yield(2)}
c~()=    -- [1]
c~()=    -- [2]
c~()=    -- [no result]

If I pass an argument then I'm exposed to the automatic execution of
command if I forget to use the result of yield :
c={::coactivity yield(1) ; yield(2)}
c~("hello")=    -- [1]
c~("hello")=    -- try to execute 'an' as a command, because the string
representation of the result returned by yield is "an Array".

No such problem with a message term : there is no attempt to execute a
command, the result is stored in the variable result.


*Maybe* the good solution would be to add a new instruction yield.
An instruction does not return a result.
But what I need is not a result, I need the arguments passed to ~resume.
ooRexx has already all what needed for that, except it works only for the
1st entry in the coactivity :
c = {::coactivity
use arg arg1, arg2    -- 1, 2
yield arg1+arg2
use arg arg1, arg2    -- should be 3, 4
yield arg1+arg2
etc...
}

c~(1,2)=    -- [3]
c~(3,4)=    -- [7]
etc...

Currently, the code above can be written like that :
c = {::coactivity
use arg arg1, arg2    -- 1, 2
args = .yield[arg1+arg2]
arg1 = args[1]    -- 3
arg2 = args[2]    -- 4
args = .yield[arg1+arg2]
etc...
}

Jean-Louis
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to