[Spirit2X] Karma post-delimiting, none & eps

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

[Spirit2X] Karma post-delimiting, none & eps

Francois Barel
I have 3 questions about none and eps generators:

1. Shouldn't none_generator's generate() method return false instead
of true? That would be consistent with Spirit2 (and make none
different from eps), and it would make the karma_none test pass.


And about post-delimiting: since Karma post-delimits, shouldn't the
general rule be "if a generator's generate() method returns false (for
a reason other than failure during post-delimiting), it does not
post-delimit"? IOW:

2. Shouldn't none_generator do no post-delimiting?

3. Shouldn't the 2 conditions in semantic_predicate's generate()
method be reversed (so that if predicate_ is false and generate()
fails, post-delimiting is not done)? That would make "eps(true)"
equivalent to "eps", and "eps(false)" to "none".


I'll be happy to apply the changes if you think they are appropriate.

Regards,
Fran├žois

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Hartmut Kaiser
> I have 3 questions about none and eps generators:
>
> 1. Shouldn't none_generator's generate() method return false instead
> of true? That would be consistent with Spirit2 (and make none
> different from eps), and it would make the karma_none test pass.

Correct, this is a bug.

> And about post-delimiting: since Karma post-delimits, shouldn't the
> general rule be "if a generator's generate() method returns false (for
> a reason other than failure during post-delimiting), it does not
> post-delimit"? IOW:
>
> 2. Shouldn't none_generator do no post-delimiting?

Correct as well, it's a bug as well :-P

> 3. Shouldn't the 2 conditions in semantic_predicate's generate()
> method be reversed (so that if predicate_ is false and generate()
> fails, post-delimiting is not done)? That would make "eps(true)"
> equivalent to "eps", and "eps(false)" to "none".

Make sense to me as well. This is probably a copy/paste error. The
delimiting needs to be done in the post stage, always.
Could you add corresponding test cases as well, please (if not there
already)?

> I'll be happy to apply the changes if you think they are appropriate.

Thanks for looking into this!
Regards Hartmut




------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Joel de Guzman-2
Hartmut Kaiser wrote:

>> I have 3 questions about none and eps generators:
>>
>> 1. Shouldn't none_generator's generate() method return false instead
>> of true? That would be consistent with Spirit2 (and make none
>> different from eps), and it would make the karma_none test pass.
>
> Correct, this is a bug.
>
>> And about post-delimiting: since Karma post-delimits, shouldn't the
>> general rule be "if a generator's generate() method returns false (for
>> a reason other than failure during post-delimiting), it does not
>> post-delimit"? IOW:
>>
>> 2. Shouldn't none_generator do no post-delimiting?
>
> Correct as well, it's a bug as well :-P

Aren't we removing 'none' as we did with Qi? Is there a real use for 'none'
in Karma? We decided there is none in Qi.

Regards,
--
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Hartmut Kaiser
> Hartmut Kaiser wrote:
> >> I have 3 questions about none and eps generators:
> >>
> >> 1. Shouldn't none_generator's generate() method return false instead
> >> of true? That would be consistent with Spirit2 (and make none
> >> different from eps), and it would make the karma_none test pass.
> >
> > Correct, this is a bug.
> >
> >> And about post-delimiting: since Karma post-delimits, shouldn't the
> >> general rule be "if a generator's generate() method returns false
> (for
> >> a reason other than failure during post-delimiting), it does not
> >> post-delimit"? IOW:
> >>
> >> 2. Shouldn't none_generator do no post-delimiting?
> >
> > Correct as well, it's a bug as well :-P
>
> Aren't we removing 'none' as we did with Qi? Is there a real use for
> 'none'
> in Karma? We decided there is none in Qi.

I'm sure there was a reason, but somehow I'm not able to remember. OTOH, as
this can be written as eps(false) we probably don't have a 'real' reason
anyways...

Let me try to remember the use case I had in mind.
Regards Hartmut

>
> Regards,
> --
> Joel de Guzman
> http://www.boostpro.com
> http://spirit.sf.net
>
>
> -----------------------------------------------------------------------
> -------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly
> and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based
> development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Spirit-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-devel


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Joel de Guzman-2
Hartmut Kaiser wrote:

>> Aren't we removing 'none' as we did with Qi? Is there a real use for
>> 'none'
>> in Karma? We decided there is none in Qi.
>
> I'm sure there was a reason, but somehow I'm not able to remember. OTOH, as
> this can be written as eps(false) we probably don't have a 'real' reason
> anyways...

There's a lot of spellings. Also, my favorite:

   !eps

There's no real reason for 'none' now.

Regards,
--
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Hartmut Kaiser
Joel,

> >> Aren't we removing 'none' as we did with Qi? Is there a real use for
> >> 'none'
> >> in Karma? We decided there is none in Qi.
> >
> > I'm sure there was a reason, but somehow I'm not able to remember.
> OTOH, as
> > this can be written as eps(false) we probably don't have a 'real'
> reason
> > anyways...
>
> There's a lot of spellings. Also, my favorite:
>
>    !eps
>
> There's no real reason for 'none' now.

Yeah, you're right. This is simple enough to be used instead of none.
Man, I was sooo proud to have written the none generator (and as you saw I
got it all wrong), now I'll have to remove it again ;-)

Regards Hartmut



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Francois Barel
In reply to this post by Hartmut Kaiser
Hartmut Kaiser wrote:
>> 3. Shouldn't the 2 conditions in semantic_predicate's generate()
>> method be reversed (so that if predicate_ is false and generate()
>> fails, post-delimiting is not done)? That would make "eps(true)"
>> equivalent to "eps", and "eps(false)" to "none".
>
> Make sense to me as well. This is probably a copy/paste error. The
> delimiting needs to be done in the post stage, always.
> Could you add corresponding test cases as well, please (if not there
> already)?

Done in r1127 (changes for eps only).

Regards,
Fran├žois

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Hartmut Kaiser
> >> 3. Shouldn't the 2 conditions in semantic_predicate's generate()
> >> method be reversed (so that if predicate_ is false and generate()
> >> fails, post-delimiting is not done)? That would make "eps(true)"
> >> equivalent to "eps", and "eps(false)" to "none".
> >
> > Make sense to me as well. This is probably a copy/paste error. The
> > delimiting needs to be done in the post stage, always.
> > Could you add corresponding test cases as well, please (if not there
> > already)?
>
> Done in r1127 (changes for eps only).

Thanks a lot! I'll remove the none later today.
Regards Hartmut



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Hartmut Kaiser
In reply to this post by Joel de Guzman-2
> >> I have 3 questions about none and eps generators:
> >>
> >> 1. Shouldn't none_generator's generate() method return false instead
> >> of true? That would be consistent with Spirit2 (and make none
> >> different from eps), and it would make the karma_none test pass.
> >
> > Correct, this is a bug.
> >
> >> And about post-delimiting: since Karma post-delimits, shouldn't the
> >> general rule be "if a generator's generate() method returns false
> (for
> >> a reason other than failure during post-delimiting), it does not
> >> post-delimit"? IOW:
> >>
> >> 2. Shouldn't none_generator do no post-delimiting?
> >
> > Correct as well, it's a bug as well :-P
>
> Aren't we removing 'none' as we did with Qi? Is there a real use for
> 'none' in Karma? We decided there is none in Qi.

Ok, removed from Karma.
Regards Hartmut


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] Karma post-delimiting, none & eps

Hartmut Kaiser
In reply to this post by Joel de Guzman-2
> >> Aren't we removing 'none' as we did with Qi? Is there a real use for
> >> 'none'
> >> in Karma? We decided there is none in Qi.
> >
> > I'm sure there was a reason, but somehow I'm not able to remember.
> OTOH, as
> > this can be written as eps(false) we probably don't have a 'real'
> reason
> > anyways...
>
> There's a lot of spellings. Also, my favorite:
>
>    !eps
>
> There's no real reason for 'none' now.

Somehow the not_predicate was completely missing in Karma. Added now.
Regards Hartmut




------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel