array->iterator in Lasso9?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

array->iterator in Lasso9?

Tim Taplin
so, is array->iterator broken in lasso9?  

It looks like most of the functionality can be reproduced by using query expressions but as I'm trying to port an existing tag over to Lasso9, I ran into this throwing an error.
It appears that iterator is not a valid method in the compatibility layer. any input? suggestions?

in a related topic, is there a list or reference of progress in which tags on tagswap are valid in lasso9, which ones have lasso9 versions and which are being worked on?  I'd rather not work thru fixing a tag if its already done somewhere else, and also, would like to contribute to those conversion efforts where possible. In most cases the changes needed are minor.

Tim Taplin




--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: array->iterator in Lasso9?

Ke Carlton-3
+1

Also noticed this, means you can't do the below easily:

#myMap->insertFrom(#myArray->iterator)

Pain for backwards compat...

Ke

On 10 Mar 2010, at 19:47, Tim Taplin <[hidden email]> wrote:

> so, is array->iterator broken in lasso9?
>
> It looks like most of the functionality can be reproduced by using  
> query expressions but as I'm trying to port an existing tag over to  
> Lasso9, I ran into this throwing an error.
> It appears that iterator is not a valid method in the compatibility  
> layer. any input? suggestions?
>
> in a related topic, is there a list or reference of progress in  
> which tags on tagswap are valid in lasso9, which ones have lasso9  
> versions and which are being worked on?  I'd rather not work thru  
> fixing a tag if its already done somewhere else, and also, would  
> like to contribute to those conversion efforts where possible. In  
> most cases the changes needed are minor.
>
> Tim Taplin
>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: array->iterator in Lasso9?

Bil Corry-3
I don't know about iterator, but you could do this:

        #myMap->merge(#myArray);

Using this definition:

        define map->merge(array::array)=> {
                #array->forEach => {
                        .insert(#1)
                }
        }


Trying the iterator code, it works without it:

=========================================================
[
local(myMap) = map(4='d',5='e');
local(myArray) = array(1='a',2='b',3='c');
#myMap->insertFrom(#myArray);
#myMap;
]

L9   =>  map(1 = a, 2 = b, 3 = c, 4 = d, 5 = e)
=========================================================


So for this specific use-case, you could do this:

=========================================================
[
define array->iterator => self;

local(myMap) = map(4='d',5='e');
local(myArray) = array(1='a',2='b',3='c');
#myMap->insertFrom(#myArray->iterator);
#myMap;
]

L9   =>  map(1 = a, 2 = b, 3 = c, 4 = d, 5 = e)
=========================================================

That definition for iterator probably will break other use-cases though...

- Bil


Ke wrote on 3/10/2010 1:41 PM:

> +1
>
> Also noticed this, means you can't do the below easily:
>
> #myMap->insertFrom(#myArray->iterator)
>
> Pain for backwards compat...
>
> Ke
>
> On 10 Mar 2010, at 19:47, Tim Taplin <[hidden email]> wrote:
>
>> so, is array->iterator broken in lasso9?
>>
>> It looks like most of the functionality can be reproduced by using
>> query expressions but as I'm trying to port an existing tag over to
>> Lasso9, I ran into this throwing an error.
>> It appears that iterator is not a valid method in the compatibility
>> layer. any input? suggestions?
>>
>> in a related topic, is there a list or reference of progress in which
>> tags on tagswap are valid in lasso9, which ones have lasso9 versions
>> and which are being worked on?  I'd rather not work thru fixing a tag
>> if its already done somewhere else, and also, would like to contribute
>> to those conversion efforts where possible. In most cases the changes
>> needed are minor.
>>
>> Tim Taplin
>>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/