Re: [Chicken-users] matchable egg: error while reporting error?

2019-06-03 Thread Peter Bex
On Mon, Jun 03, 2019 at 09:25:51AM +0200, Marco Maggi wrote:
> I understand  this.  But  the problem  looks like  MATCH-SYNTAX-ERROR is
> used with  an invalid  syntax by  the "matchable"  internals themselves.
> What I  expected is an error  during the expansion of  MATCH, not during
> the expansion of MATCH-SYNTAX-ERROR.

Oh, I see.  matchable is written as portable Scheme, and it "abuses"
match-syntax-error by deliberately passing an invalid number of arguments
to raise an error when it sees something that goes wrong.  This is just a
consequence of having a portable implementation like that.

But that's just my opinion, if you feel strongly about it I would make a
ticket for the egg's author.

Cheers,
Peter


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] matchable egg: error while reporting error?

2019-06-03 Thread Marco Maggi
Peter Bex wrote:

> On Mon, Jun 03, 2019 at 06:21:56AM +0200, Marco Maggi wrote:
>> Ciao,

>>   with CHICKEN  5.0.0 this  form using  MATCH from  "matchable" (updated
>> right now):

>> (match '(#:a #:b c d)
>>   (((? keyword? k*) ... (? symbol? s*) ...)
>>(pretty-print k*)
>>(pretty-print s*))
>>   (_
>>(pretty-print 'no)))

>> fails with:

>> Error: during expansion of (match-syntax-error283 ...) - no rule matches 
>> form: (match-syntax-error "multiple ellipsis patterns not allowed at same 
>> level")

>> which looks like an error while reporting an error.

> It's complaining about your pattern, which is ambiguous.

I understand  this.  But  the problem  looks like  MATCH-SYNTAX-ERROR is
used with  an invalid  syntax by  the "matchable"  internals themselves.
What I  expected is an error  during the expansion of  MATCH, not during
the expansion of MATCH-SYNTAX-ERROR.
-- 
Marco Maggi

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] matchable egg: error while reporting error?

2019-06-03 Thread Peter Bex
On Mon, Jun 03, 2019 at 06:21:56AM +0200, Marco Maggi wrote:
> Ciao,
> 
>   with CHICKEN  5.0.0 this  form using  MATCH from  "matchable" (updated
> right now):
> 
> (match '(#:a #:b c d)
>   (((? keyword? k*) ... (? symbol? s*) ...)
>(pretty-print k*)
>(pretty-print s*))
>   (_
>(pretty-print 'no)))
> 
> fails with:
> 
> Error: during expansion of (match-syntax-error283 ...) - no rule matches 
> form: (match-syntax-error "multiple ellipsis patterns not allowed at same 
> level")
> 
> which looks like an error while reporting an error.

Hi Marco,

It's complaining about your pattern, which is ambiguous.  Well,
you could say it's not strictly ambiguous, but the pattern matcher
doesn't know that.

It expands to a syntax-rules pattern, which cannot contain multiple
ellipsis at the same level.  The reason?

How should 
(syntax-rules ()
  ((foo bar "haha" more ... "haha" even-more ...)
   (list even-more ...)))
match
(blah 1 "haha" 2 3 4 "haha" 5 6 7 "haha" 8 9 10 "haha")?

It could return either (5 6 7 "haha" 8 9 10 "haha"),
(8 9 10 "haha") or ().

Normally one would solve this by saying it could be greedy or
non-greedy (like in regexes), but the spec doesn't specify, so
strictly speaking this is an error.  That's what gets reported.

>   By  the way:  should this  be reported  directly on  the bugs  server,
> without previous confirmation by someone else?   Of is it fine to report
> it here first?   And do I really  need to privately contact  a person to
> get an account on the bugs server?

If you still think this is a bug, it's a bug in matchable.  I think
there's no upstream repository for it (just the code on synthcode.com)
So you can report it on bugs.call-cc.org, assign it to "ashinn" (that's
matchable's author).

Cheers,
Peter


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users