LP8.6 Polymorphism/Override

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

LP8.6 Polymorphism/Override

Steffan A. Cline
It’s been a while and am rusty on the topic of polymorphism and overriding in regards to custom tags in LP8.

The manual discusses it in a section called Overriding but it’s doesn’t really have any applicable examples. In the book, the tag used is based on the type of data passed in.

This example would be using unnamed parameters and I’d just iterate through the list.
define_tag(‘myTag’)
        handle params
/define_tag

In this example, I’ll have multiple named parameters. I tried to use the -criteria but couldn’t get it to work.
define_tag(‘myTag’,-optional=‘param’,-optional=‘op’)
        handle params
/define_tag

The idea is that the tag can be used either way - named or unnamed parameters. In my tests I get all kinds of weird errors including the lovely no-error error code and message.

If I can’t get this to work via the standard programming structure, I’ll just have to use an if statement inside the tag that looks for named vs unnamed parameters.

Anyone have any examples laying around?


Steffan A. Cline
[hidden email]
602-793-0014





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

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: LP8.6 Polymorphism/Override

Bil Corry-3
Are you trying to defining multiple tags with the same name but different parameter profiles or one tag that has a bunch of options as far parameters go?


- Bil

> On Jan 11, 2019, at 12:36 AM, Steffan A. Cline <[hidden email]> wrote:
>
> It’s been a while and am rusty on the topic of polymorphism and overriding in regards to custom tags in LP8.
>
> The manual discusses it in a section called Overriding but it’s doesn’t really have any applicable examples. In the book, the tag used is based on the type of data passed in.
>
> This example would be using unnamed parameters and I’d just iterate through the list.
> define_tag(‘myTag’)
>    handle params
> /define_tag
>
> In this example, I’ll have multiple named parameters. I tried to use the -criteria but couldn’t get it to work.
> define_tag(‘myTag’,-optional=‘param’,-optional=‘op’)
>    handle params
> /define_tag
>
> The idea is that the tag can be used either way - named or unnamed parameters. In my tests I get all kinds of weird errors including the lovely no-error error code and message.
>
> If I can’t get this to work via the standard programming structure, I’ll just have to use an if statement inside the tag that looks for named vs unnamed parameters.
>
> Anyone have any examples laying around?
>
>
> Steffan A. Cline
> [hidden email]
> 602-793-0014
>
>
>
>
>
> #############################################################
>
> 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: LP8.6 Polymorphism/Override

Steffan A. Cline
The former. Multiple tags but different parameters. Named versus unnamed parameters.


Thanks,
Steffan Cline
[hidden email]
602-793-0014

> On Jan 11, 2019, at 7:38 AM, Bil Corry <[hidden email]> wrote:
>
> Are you trying to defining multiple tags with the same name but different parameter profiles or one tag that has a bunch of options as far parameters go?
>
>
> - Bil
>
>> On Jan 11, 2019, at 12:36 AM, Steffan A. Cline <[hidden email]> wrote:
>>
>> It’s been a while and am rusty on the topic of polymorphism and overriding in regards to custom tags in LP8.
>>
>> The manual discusses it in a section called Overriding but it’s doesn’t really have any applicable examples. In the book, the tag used is based on the type of data passed in.
>>
>> This example would be using unnamed parameters and I’d just iterate through the list.
>> define_tag(‘myTag’)
>>   handle params
>> /define_tag
>>
>> In this example, I’ll have multiple named parameters. I tried to use the -criteria but couldn’t get it to work.
>> define_tag(‘myTag’,-optional=‘param’,-optional=‘op’)
>>   handle params
>> /define_tag
>>
>> The idea is that the tag can be used either way - named or unnamed parameters. In my tests I get all kinds of weird errors including the lovely no-error error code and message.
>>
>> If I can’t get this to work via the standard programming structure, I’ll just have to use an if statement inside the tag that looks for named vs unnamed parameters.
>>
>> Anyone have any examples laying around?
>>
>>
>> Steffan A. Cline
>> [hidden email]
>> 602-793-0014
>>
>>
>>
>>
>>
>> #############################################################
>>
>> 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]>
Reply | Threaded
Open this post in threaded view
|

Re: LP8.6 Polymorphism/Override

Bil Corry-3
Just to make sure we're talking about the same thing, it's Overloading as
discussed on page 702 under "Criteria" of the LP8.5 Language Guide:

https://www.lassosoft.com/usercontent/pdfs/Lasso_85_LanguageGuide.pdf

As far as setting up the multiple tags, define the tag that has named
params first (priority = high) with a criteria, and define the second
catchall tag with priority = low (no criteria).

It will be easier to help if you have an example that isn't working.

- Bil


On Fri, Jan 11, 2019 at 7:39 AM Steffan Cline <[hidden email]> wrote:

> The former. Multiple tags but different parameters. Named versus unnamed
> parameters.
>
>
> Thanks,
> Steffan Cline
> [hidden email]
> 602-793-0014
>
> > On Jan 11, 2019, at 7:38 AM, Bil Corry <[hidden email]> wrote:
> >
> > Are you trying to defining multiple tags with the same name but
> different parameter profiles or one tag that has a bunch of options as far
> parameters go?
> >
> >
> > - Bil
> >
> >> On Jan 11, 2019, at 12:36 AM, Steffan A. Cline <[hidden email]>
> wrote:
> >>
> >> It’s been a while and am rusty on the topic of polymorphism and
> overriding in regards to custom tags in LP8.
> >>
> >> The manual discusses it in a section called Overriding but it’s doesn’t
> really have any applicable examples. In the book, the tag used is based on
> the type of data passed in.
> >>
> >> This example would be using unnamed parameters and I’d just iterate
> through the list.
> >> define_tag(‘myTag’)
> >>   handle params
> >> /define_tag
> >>
> >> In this example, I’ll have multiple named parameters. I tried to use
> the -criteria but couldn’t get it to work.
> >> define_tag(‘myTag’,-optional=‘param’,-optional=‘op’)
> >>   handle params
> >> /define_tag
> >>
> >> The idea is that the tag can be used either way - named or unnamed
> parameters. In my tests I get all kinds of weird errors including the
> lovely no-error error code and message.
> >>
> >> If I can’t get this to work via the standard programming structure,
> I’ll just have to use an if statement inside the tag that looks for named
> vs unnamed parameters.
> >>
> >> Anyone have any examples laying around?
> >>
> >>
> >> Steffan A. Cline
> >> [hidden email]
> >> 602-793-0014
> >>
> >>
> >>
> >>
> >>
> >> #############################################################
> >>
> >> 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]>

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

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: LP8.6 Polymorphism/Override

Steffan A. Cline
Yeah, that is what I was looking at.

The examples they had for criteria were based on the parameter type. There’s no easy way to tell between named and unnamed parameters.

Thanks,
Steffan Cline
[hidden email]
602-793-0014

> On Jan 11, 2019, at 12:18 PM, Bil Corry <[hidden email]> wrote:
>
> Just to make sure we're talking about the same thing, it's Overloading as
> discussed on page 702 under "Criteria" of the LP8.5 Language Guide:
>
> https://www.lassosoft.com/usercontent/pdfs/Lasso_85_LanguageGuide.pdf
>
> As far as setting up the multiple tags, define the tag that has named
> params first (priority = high) with a criteria, and define the second
> catchall tag with priority = low (no criteria).
>
> It will be easier to help if you have an example that isn't working.
>
> - Bil
>
>
>> On Fri, Jan 11, 2019 at 7:39 AM Steffan Cline <[hidden email]> wrote:
>>
>> The former. Multiple tags but different parameters. Named versus unnamed
>> parameters.
>>
>>
>> Thanks,
>> Steffan Cline
>> [hidden email]
>> 602-793-0014
>>
>>> On Jan 11, 2019, at 7:38 AM, Bil Corry <[hidden email]> wrote:
>>>
>>> Are you trying to defining multiple tags with the same name but
>> different parameter profiles or one tag that has a bunch of options as far
>> parameters go?
>>>
>>>
>>> - Bil
>>>
>>>> On Jan 11, 2019, at 12:36 AM, Steffan A. Cline <[hidden email]>
>> wrote:
>>>>
>>>> It’s been a while and am rusty on the topic of polymorphism and
>> overriding in regards to custom tags in LP8.
>>>>
>>>> The manual discusses it in a section called Overriding but it’s doesn’t
>> really have any applicable examples. In the book, the tag used is based on
>> the type of data passed in.
>>>>
>>>> This example would be using unnamed parameters and I’d just iterate
>> through the list.
>>>> define_tag(‘myTag’)
>>>>  handle params
>>>> /define_tag
>>>>
>>>> In this example, I’ll have multiple named parameters. I tried to use
>> the -criteria but couldn’t get it to work.
>>>> define_tag(‘myTag’,-optional=‘param’,-optional=‘op’)
>>>>  handle params
>>>> /define_tag
>>>>
>>>> The idea is that the tag can be used either way - named or unnamed
>> parameters. In my tests I get all kinds of weird errors including the
>> lovely no-error error code and message.
>>>>
>>>> If I can’t get this to work via the standard programming structure,
>> I’ll just have to use an if statement inside the tag that looks for named
>> vs unnamed parameters.
>>>>
>>>> Anyone have any examples laying around?
>>>>
>>>>
>>>> Steffan A. Cline
>>>> [hidden email]
>>>> 602-793-0014
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> 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]>
>
> #############################################################
>
> 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: LP8.6 Polymorphism/Override

Bil Corry-3
You can reference the named params directly.  So if you have a tag that
only has named params, use it in the criteria for the first tag, and use
the tag with unnamed params as the catchall.  But if you're trying to use
named and unnamed params for both tags, you'll have to do a bit of work in
the criteria and you may be just better off having a single tag that
iterates through all of the parameters.

It's hard to be more specific without an example of what you want to do.


- Bil


On Fri, Jan 11, 2019 at 3:14 PM Steffan Cline <[hidden email]> wrote:

> Yeah, that is what I was looking at.
>
> The examples they had for criteria were based on the parameter type.
> There’s no easy way to tell between named and unnamed parameters.
>
> Thanks,
> Steffan Cline
> [hidden email]
> 602-793-0014
>
> > On Jan 11, 2019, at 12:18 PM, Bil Corry <[hidden email]> wrote:
> >
> > Just to make sure we're talking about the same thing, it's Overloading as
> > discussed on page 702 under "Criteria" of the LP8.5 Language Guide:
> >
> > https://www.lassosoft.com/usercontent/pdfs/Lasso_85_LanguageGuide.pdf
> >
> > As far as setting up the multiple tags, define the tag that has named
> > params first (priority = high) with a criteria, and define the second
> > catchall tag with priority = low (no criteria).
> >
> > It will be easier to help if you have an example that isn't working.
> >
> > - Bil
> >
> >
> >> On Fri, Jan 11, 2019 at 7:39 AM Steffan Cline <[hidden email]>
> wrote:
> >>
> >> The former. Multiple tags but different parameters. Named versus unnamed
> >> parameters.
> >>
> >>
> >> Thanks,
> >> Steffan Cline
> >> [hidden email]
> >> 602-793-0014
> >>
> >>> On Jan 11, 2019, at 7:38 AM, Bil Corry <[hidden email]> wrote:
> >>>
> >>> Are you trying to defining multiple tags with the same name but
> >> different parameter profiles or one tag that has a bunch of options as
> far
> >> parameters go?
> >>>
> >>>
> >>> - Bil
> >>>
> >>>> On Jan 11, 2019, at 12:36 AM, Steffan A. Cline <[hidden email]>
> >> wrote:
> >>>>
> >>>> It’s been a while and am rusty on the topic of polymorphism and
> >> overriding in regards to custom tags in LP8.
> >>>>
> >>>> The manual discusses it in a section called Overriding but it’s
> doesn’t
> >> really have any applicable examples. In the book, the tag used is based
> on
> >> the type of data passed in.
> >>>>
> >>>> This example would be using unnamed parameters and I’d just iterate
> >> through the list.
> >>>> define_tag(‘myTag’)
> >>>>  handle params
> >>>> /define_tag
> >>>>
> >>>> In this example, I’ll have multiple named parameters. I tried to use
> >> the -criteria but couldn’t get it to work.
> >>>> define_tag(‘myTag’,-optional=‘param’,-optional=‘op’)
> >>>>  handle params
> >>>> /define_tag
> >>>>
> >>>> The idea is that the tag can be used either way - named or unnamed
> >> parameters. In my tests I get all kinds of weird errors including the
> >> lovely no-error error code and message.
> >>>>
> >>>> If I can’t get this to work via the standard programming structure,
> >> I’ll just have to use an if statement inside the tag that looks for
> named
> >> vs unnamed parameters.
> >>>>
> >>>> Anyone have any examples laying around?
>
>

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

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: LP8.6 Polymorphism/Override

Ke Carlton-3
In reply to this post by Steffan A. Cline
IIRC named parameters (possibly just optional ones) can't be used for
signature matching / dispatch. Try using a non-named param for the second
parameter in your override.

On Sat, Jan 12, 2019 at 11:14 AM Steffan Cline <[hidden email]> wrote:

> Yeah, that is what I was looking at.
>
> The examples they had for criteria were based on the parameter type.
> There’s no easy way to tell between named and unnamed parameters.
>
> Thanks,
> Steffan Cline
> [hidden email]
> 602-793-0014

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

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]>