Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Mike Cowlishaw

 

One other point I should probably make related to this is that the
referencing operator (currently spelled "&")   ...
 

I trust that spelling is still considered an open issue.  :-)
 
I'm warming to using '>' on both sides .. at least it implies some sort of
movement/look elsewhere.   My second choice would be '*' (as in C).   
 
All other characters and character combinations that are currently not valid
as prefix operations could be possibilities, with the exception of '&'...
 
Mike
 
 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Rick McGuire
On Mon, Apr 16, 2018 at 8:04 AM, Mike Cowlishaw  wrote:

>
>
>
> One other point I should probably make related to this is that the
> referencing operator (currently spelled "&")   ...
>
>
> I trust that spelling is still considered an open issue.  :-)
>
> I'm warming to using '>' on both sides .. at least it implies some sort of
> movement/look elsewhere.   My second choice would be '*' (as in C).
>

I could live with '>'. I'm probably as opposed to using '*' as you are to
'&' :-)

>
> All other characters and character combinations that are currently not
> valid as prefix operations could be possibilities, with the exception of
> '&'...
>
> Mike
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Erich Steinböck
>
> One other point I should probably make related to this is that the
> referencing operator (currently spelled "&")
>

Can this maybe done with existing ooRexx syntax?  Like
`call routine alpha, .Reference~new(beta), gamma` and a simple `use a, b, c`

Alternatives to `.Reference~new()` might be `.Alias~new()`or `.Ref[]`or such
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Rick McGuire
On Mon, Apr 16, 2018 at 8:53 AM, Erich Steinböck  wrote:

> One other point I should probably make related to this is that the
>> referencing operator (currently spelled "&")
>>
>
> Can this maybe done with existing ooRexx syntax?  Like
> `call routine alpha, .Reference~new(beta), gamma` and a simple `use a, b,
> c`
>
> Alternatives to `.Reference~new()` might be `.Alias~new()`or `.Ref[]`or
> such
>

There's a bit of ugliness with trying to do that. The new method never sees
the variable name, only the result of evaluating the variable. That would
require some special mechanism that would somehow make that method a
special case, plus additional magic that would allow the new method to
reach back into the calling context to retrieve the variable reference. One
of the reasons I made the NEW method on VariableReference throw an error
was to prevent situations where resolving a variable did not make sense,
such as in native code.  Using an operator acts as an instruction to the
local context to create a reference and uses minimal amounts of syntax to
do so. We've already seen, for example, that .array~of(1,2,3) is more than
most people want to type, which is why the syntactic sugar array expression
was added for 5.0.0.

As for using the back tick, that really would not work. It's too easily
confused with the other single quote and is almost invisible on some
screens. I actually had to wipe my screen down even to see that that was
what you were proposing.

Rick

>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Rony G. Flatscher
On 16.04.2018 14:08, Rick McGuire wrote:
>
> On Mon, Apr 16, 2018 at 8:04 AM, Mike Cowlishaw  >
> wrote:
>
>  
>
> One other point I should probably make related to this is that the 
> referencing operator
> (currently spelled "&")   ...
>  
>
> I trust that spelling is still considered an open issue.  :-)
>  
> I'm warming to using '>' on both sides .. at least it implies some sort 
> of movement/look
> elsewhere.   My second choice would be '*' (as in C).  
>
>
> I could live with '>'. I'm probably as opposed to using '*' as you are to '&' 
> :-) 
>
>  
> All other characters and character combinations that are currently not 
> valid as prefix
> operations could be possibilities, with the exception of '&'...
>  
> Mike
>
How about using '^' as the operator symbol for "variable reference"?

E.g.:

a = 123
call foo ^a
say a  -- displays "124"

::routine foo
  use arg ^someVariable

  someVariable += 1
  return

---rony


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Address With progress

2018-04-16 Thread Erich Steinböck
Should this print "line" twice?  It currently prints two null strings.

~~~
stem. = "line"
stem.0 = 2
address "" "cat" with input using ( stem. )"
~~~

When using explicit assignments, this works as expected
stem.1 = "line"; stem.2 = "line"
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


[Oorexx-devel] Ad multiple assignments idea (Re: Discussion: Adding variable references to ooRexx.

2018-04-16 Thread Rony G. Flatscher
On 13.04.2018 09:48, Erich Steinböck wrote:
>
> This will generally be used in a few selective place, such as situations 
> where you wish to
> return multiple values back from a call or method
>
>
> A neat way to return multiple values might be a syntax like this:
>
>     r1, r2, .. = function(a1, a2, ..)
>
> with function using
>
>     return r1, r2, ...
>
>

The return statement in ooRexx 5.0 beta would return an array in the above case 
already, containing
the values to be returned.

How about then to generalize the idea to allow "multiple assignments" from 
orderable collections?

E.g.

v1,v2,...=function(a1,a2,...)  -- as per Erich's suggestion

... but then also in general: ...

arr=r1,r2,...   -- define array (an orderable collection, could be a 
List, a Queue, et.al.)
v1,v2,...=arr   -- multiple assignment in the collection's order

---rony

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Rick McGuire
On Mon, Apr 16, 2018 at 9:54 AM, Rony G. Flatscher 
wrote:

> On 16.04.2018 14:08, Rick McGuire wrote:
>
>
> On Mon, Apr 16, 2018 at 8:04 AM, Mike Cowlishaw 
> wrote:
>
>>
>>
>> One other point I should probably make related to this is that the
>> referencing operator (currently spelled "&")   ...
>>
>>
>> I trust that spelling is still considered an open issue.  :-)
>>
>> I'm warming to using '>' on both sides .. at least it implies some sort
>> of movement/look elsewhere.   My second choice would be '*' (as in C).
>>
>
> I could live with '>'. I'm probably as opposed to using '*' as you are to
> '&' :-)
>
>>
>> All other characters and character combinations that are currently not
>> valid as prefix operations could be possibilities, with the exception of
>> '&'...
>>
>> Mike
>>
>> How about using '^' as the operator symbol for "variable reference"?
>
> carat has some compatibility problems with other Rexx interpreters that
interpreted the carat as a logical not. I'd prefer to stay away from that.
In any event, I just committed the changes to use '>' rather than '&'.

Rick




> E.g.:
>
> a = 123
> call foo ^a
> say a  -- displays "124"
>
> ::routine foo
>   use arg ^someVariable
>
>   someVariable += 1
>   return
>
> ---rony
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Address With progress

2018-04-16 Thread Rick McGuire
Yep, it probably should. I'll take a look at it.

Rick

On Mon, Apr 16, 2018 at 10:04 AM, Erich Steinböck <
erich.steinbo...@gmail.com> wrote:

> Should this print "line" twice?  It currently prints two null strings.
>
> ~~~
> stem. = "line"
> stem.0 = 2
> address "" "cat" with input using ( stem. )"
> ~~~
>
> When using explicit assignments, this works as expected
> stem.1 = "line"; stem.2 = "line"
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Ad multiple assignments idea (Re: Discussion: Adding variable references to ooRexx.

2018-04-16 Thread Rick McGuire
This raises all sorts of issues as to what is getting returned, how to
handle mismatches in assignment values and the fact that any errors can
only get detected at the point of return. I don't really see this as being
a very clean change.

Rick

On Mon, Apr 16, 2018 at 10:10 AM, Rony G. Flatscher  wrote:

> On 13.04.2018 09:48, Erich Steinböck wrote:
>
> This will generally be used in a few selective place, such as situations
>> where you wish to return multiple values back from a call or method
>
>
> A neat way to return multiple values might be a syntax like this:
>
> r1, r2, .. = function(a1, a2, ..)
>
> with function using
>
> return r1, r2, ...
>
>>
>>
> The return statement in ooRexx 5.0 beta would return an array in the above
> case already, containing the values to be returned.
>
> How about then to generalize the idea to allow "multiple assignments" from
> orderable collections?
>
> E.g.
>
> v1,v2,...=function(a1,a2,...)  -- as per Erich's suggestion
>
> ... but then also in general: ...
>
> arr=r1,r2,... -- define array (an orderable collection, could be a List, a 
> Queue, et.al.)
> v1,v2,...=arr   -- multiple assignment in the collection's order
>
> ---rony
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Rony G. Flatscher
On 16.04.2018 16:21, Rick McGuire wrote:
>
>
> On Mon, Apr 16, 2018 at 9:54 AM, Rony G. Flatscher  > wrote:
>
> On 16.04.2018 14:08, Rick McGuire wrote:
>>
>> On Mon, Apr 16, 2018 at 8:04 AM, Mike Cowlishaw > > wrote:
>>
>>  
>>
>> One other point I should probably make related to this is that 
>> the referencing
>> operator (currently spelled "&")   ...
>>  
>>
>> I trust that spelling is still considered an open issue.  :-)
>>  
>> I'm warming to using '>' on both sides .. at least it implies some 
>> sort of movement/look
>> elsewhere.   My second choice would be '*' (as in C).  
>>
>>
>> I could live with '>'. I'm probably as opposed to using '*' as you are 
>> to '&' :-) 
>>
>>  
>> All other characters and character combinations that are currently 
>> not valid as prefix
>> operations could be possibilities, with the exception of '&'...
>>  
>> Mike
>>
> How about using '^' as the operator symbol for "variable reference"?
>
> carat has some compatibility problems with other Rexx interpreters that 
> interpreted the carat as a
> logical not. I'd prefer to stay away from that. In any event, I just 
> committed the changes to use
> '>' rather than '&'.
>
In case someone wants to experiment with this I just created a 64-bit Windows 
version of Rick's
reference sandbox (using '>' rather than '&') which you can download from here:
.

There is a small test script "test_gt.rex" using '>' there as well.

Here

---rony

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] USE ARG default values with references.

2018-04-16 Thread Mike Cowlishaw
 

carat has some compatibility problems with other Rexx interpreters that
interpreted the carat as a logical not. I'd prefer to stay away from that.
In any event, I just committed the changes to use '>' rather than '&'. 
 

:-)))   Many thanks.
 
Mike 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel