Container tag not returning

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

Container tag not returning

Daniel Logue
Hi List,

The following refers to Lasso 8.6.

This is an interesting issue - it appears that anything inside of the 'run_children' of a custom container tag won't execute 'return' in the context of another (non-container) tag.  Consider the following:

[

define_tag(
        'inner',
        -container
);
        return(run_children);
/define_tag;

define_tag(
        'outer'
);
        inner;
                return(true); // does not return
        /inner;
        return(false);
/define_tag;

outer(); // false (instead of true)

]

Even though outer() should return true, that line is actually being run by run_children; and it appears that run_children does not seem to realize that it's in the context of another tag, and does not return (and stop execution of) the outer tag.

If I was executing a built-in container tag, like inline, the outer() tag would return true.

Has anyone come across this, and is there any other technique I might be missing?

Thanks,
Daniel

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Container tag not returning

Ke Carlton-3
I believe it's down to scope — but it's been a long time since I've touched
Lasso 8.

You should be able to do want you need, with something like the below
reworked accordingly:

define_tag('outer');
    local('out') = false;
    inner;
        #out = true;
    /inner;
    return(#out);
/define_tag;

A lot of this is much cleaner and clearer in Lasso 9 now:

define inner => {
    return givenblock()
}

define outer => {
    inner => {
        return true
    }
    return false
}

outer // true

Ke





On Tue, May 19, 2015 at 11:45 AM Daniel Logue <[hidden email]> wrote:

> Hi List,
>
> The following refers to Lasso 8.6.
>
> This is an interesting issue - it appears that anything inside of the
> 'run_children' of a custom container tag won't execute 'return' in the
> context of another (non-container) tag.  Consider the following:
>
> [
>
> define_tag(
>         'inner',
>         -container
> );
>         return(run_children);
> /define_tag;
>
> define_tag(
>         'outer'
> );
>         inner;
>                 return(true); // does not return
>         /inner;
>         return(false);
> /define_tag;
>
> outer(); // false (instead of true)
>
> ]
>
> Even though outer() should return true, that line is actually being run by
> run_children; and it appears that run_children does not seem to realize
> that it's in the context of another tag, and does not return (and stop
> execution of) the outer tag.
>
> If I was executing a built-in container tag, like inline, the outer() tag
> would return true.
>
> Has anyone come across this, and is there any other technique I might be
> missing?
>
> Thanks,
> Daniel
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: Container tag not returning

Daniel Logue
Hi Ke,

Yes, that worked.  I appreciate the help.  I'm not sure if this technique is going to work as well for my particular use-case (my example was pretty dumbed down), but I appreciate the help nonetheless.

Thanks,
Daniel

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ke Carlton
Sent: Monday, May 18, 2015 6:50 PM
To: Lasso Talk
Subject: Re: Container tag not returning

I believe it's down to scope — but it's been a long time since I've touched Lasso 8.

You should be able to do want you need, with something like the below reworked accordingly:

define_tag('outer');
    local('out') = false;
    inner;
        #out = true;
    /inner;
    return(#out);
/define_tag;

A lot of this is much cleaner and clearer in Lasso 9 now:

define inner => {
    return givenblock()
}

define outer => {
    inner => {
        return true
    }
    return false
}

outer // true

Ke





On Tue, May 19, 2015 at 11:45 AM Daniel Logue <[hidden email]> wrote:

> Hi List,
>
> The following refers to Lasso 8.6.
>
> This is an interesting issue - it appears that anything inside of the
> 'run_children' of a custom container tag won't execute 'return' in the
> context of another (non-container) tag.  Consider the following:
>
> [
>
> define_tag(
>         'inner',
>         -container
> );
>         return(run_children);
> /define_tag;
>
> define_tag(
>         'outer'
> );
>         inner;
>                 return(true); // does not return
>         /inner;
>         return(false);
> /define_tag;
>
> outer(); // false (instead of true)
>
> ]
>
> Even though outer() should return true, that line is actually being
> run by run_children; and it appears that run_children does not seem to
> realize that it's in the context of another tag, and does not return
> (and stop execution of) the outer tag.
>
> If I was executing a built-in container tag, like inline, the outer()
> tag would return true.
>
> Has anyone come across this, and is there any other technique I might
> be missing?
>
> Thanks,
> Daniel
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email] Official list
> archives available at http://www.lassotalk.com To unsubscribe, E-mail
> to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email] Official list archives available at http://www.lassotalk.com To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>