Lasso types and access

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

Lasso types and access

decorior
HI, All:

Nice slow day here!

I have been looking through the docs so I can get a very clear understanding of how lasso works.

if I define a type during the startup of lasso i.e. in one of the lasso folders, it seems like that type is generally available for the lifetime of the instance. Can it be changed in any way?

However, if I define the type in a page then it only affect that page.

Is there any way to protect a type that is defined at the startup?

Deco




#############################################################
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: Lasso types and access

Brad Lindsay
On 5/26/14, 5:41 PM, deco rior wrote:
> HI, All:
>
> Nice slow day here!
>
> I have been looking through the docs so I can get a very clear understanding of how lasso works.

Which version?


> if I define a type during the startup of lasso i.e. in one of the lasso folders, it seems like that type is generally available for the lifetime of the instance. Can it be changed in any way?

Easy to add public methods in Lasso 9:

define typeName->newPublicMethod() => {}


> However, if I define the type in a page then it only affect that page.

Really? Is this an 8.x behavior? Totally not true of Lasso 9


> Is there any way to protect a type that is defined at the startup?

What do you mean by protect?


Brad
#############################################################
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: Lasso types and access

decorior
See below
On May 26, 2014, at 5:06 PM, Brad Lindsay <[hidden email]> wrote:

> On 5/26/14, 5:41 PM, deco rior wrote:
>> HI, All:
>>
>> Nice slow day here!
>>
>> I have been looking through the docs so I can get a very clear understanding of how lasso works.
>
> Which version?


lasso 9
>
>
>> if I define a type during the startup of lasso i.e. in one of the lasso folders, it seems like that type is generally available for the lifetime of the instance. Can it be changed in any way?
>
> Easy to add public methods in Lasso 9:
>
> define typeName->newPublicMethod() => {}


Ok, agreed
>
>
>> However, if I define the type in a page then it only affect that page.
>
> Really? Is this an 8.x behavior? Totally not true of Lasso 9



So, if I define a type on a page it is then basically available to other active client accessing that lasso instance?


>
>
>> Is there any way to protect a type that is defined at the startup?
>
> What do you mean by protect?


I meant prevent it from being change locally if redefined

>
>
> Brad
> #############################################################
> 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: Lasso types and access

Ke Carlton-3
In reply to this post by decorior
Hello Deco,

Once types are defined they are available within that instances from then
onwards, whether defined at start up on or page.

"However, if I define the type in a page then it only affect that page." —
this is incorrect. It will affect the type from then onwards, all
definitions are "global" to use previous terminology.

There is an undocumented frozen keyword that prevents methods from being
replace — but not types:


define frozen_method => frozen {
   return 'Can\'t be changed'
}


But I'm not sure how or why you would wan't to use the above.

Ke

On 27 May 2014 09:41, deco rior <[hidden email]> wrote:

> HI, All:
>
> Nice slow day here!
>
> I have been looking through the docs so I can get a very clear
> understanding of how lasso works.
>
> if I define a type during the startup of lasso i.e. in one of the lasso
> folders, it seems like that type is generally available for the lifetime of
> the instance. Can it be changed in any way?
>
> However, if I define the type in a page then it only affect that page.
>
> Is there any way to protect a type that is defined at the startup?
>
> Deco
>
>
>
>
> #############################################################
> 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: Lasso types and access

stevepiercy
In reply to this post by decorior
On 5/26/14 at 5:12 PM, [hidden email] (deco rior) pronounced:

>>> However, if I define the type in a page then it only affect that page.
>>
>>Really? Is this an 8.x behavior? Totally not true of Lasso 9
>
>So, if I define a type on a page it is then basically available
>to other active client accessing that lasso instance?

Yes.

I found out the hard way when migrating an 8 solution to 9.  A
method with the same name was defined in three different pages,
but with a different function returning different results.  
Whichever page was requested first defined the method on all
other pages.  This caused much WTF-ery!

I hate inheriting bad code.

I would presume that in 8, each request would load the method
defined in its own page, otherwise the original programmer would
not have written it that way.  I never bothered to test that theory.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

#############################################################
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: Lasso types and access

Ke Carlton-3
Yes, i think Lasso 8.5 had three (?) namespaces:

   - namespace_global
   - namespace_page
   - the local namespace

If I recall correctly namespace_page was the default and definitions only
existed within the scope of that page. If you wanted anything to stick
globally you would need to use namespace_global. Distant times.

Ke

On 27 May 2014 12:18, Steve Piercy - Web Site Builder
<[hidden email]>wrote:

>
> I would presume that in 8, each request would load the method defined in
> its own page, otherwise the original programmer would not have written it
> that way.  I never bothered to test that theory.
>
> --steve
#############################################################
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: Lasso types and access

decorior
Thanks, everyone!

It was not absolutely clear from the docs, but it did seem that was what I was seeing.

Deco
On May 26, 2014, at 6:41 PM, Ke Carlton <[hidden email]> wrote:

> Yes, i think Lasso 8.5 had three (?) namespaces:
>
>   - namespace_global
>   - namespace_page
>   - the local namespace
>
> If I recall correctly namespace_page was the default and definitions only
> existed within the scope of that page. If you wanted anything to stick
> globally you would need to use namespace_global. Distant times.
>
> Ke
>
> On 27 May 2014 12:18, Steve Piercy - Web Site Builder
> <[hidden email]>wrote:
>
>>
>> I would presume that in 8, each request would load the method defined in
>> its own page, otherwise the original programmer would not have written it
>> that way.  I never bothered to test that theory.
>>
>> --steve
> #############################################################
> 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: Lasso types and access

Bil Corry-3
In reply to this post by Ke Carlton-3
The takeaway is to never share a lasso instance with a developer you don't
trust.

- Bil


On Tue, May 27, 2014 at 1:34 AM, Ke Carlton <[hidden email]> wrote:

> Hello Deco,
>
> Once types are defined they are available within that instances from then
> onwards, whether defined at start up on or page.
>
> "However, if I define the type in a page then it only affect that page." —
> this is incorrect. It will affect the type from then onwards, all
> definitions are "global" to use previous terminology.
>
> There is an undocumented frozen keyword that prevents methods from being
> replace — but not types:
>
>
> define frozen_method => frozen {
>    return 'Can\'t be changed'
> }
>
>
> But I'm not sure how or why you would wan't to use the above.
>
> Ke
>
> On 27 May 2014 09:41, deco rior <[hidden email]> wrote:
>
> > HI, All:
> >
> > Nice slow day here!
> >
> > I have been looking through the docs so I can get a very clear
> > understanding of how lasso works.
> >
> > if I define a type during the startup of lasso i.e. in one of the lasso
> > folders, it seems like that type is generally available for the lifetime
> of
> > the instance. Can it be changed in any way?
> >
> > However, if I define the type in a page then it only affect that page.
> >
> > Is there any way to protect a type that is defined at the startup?
> >
> > Deco
> >
> >
> >
> >
> > #############################################################
> > 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]>