* bug#18604: master srfi-26 cute compile error
@ 2014-10-02 12:14 Daniel Llorens
2014-10-05 17:12 ` Mark H Weaver
2016-06-21 21:20 ` Andy Wingo
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Llorens @ 2014-10-02 12:14 UTC (permalink / raw)
To: 18604
stable-2.0 with either cut or cute works. The compiler in master works for cut but not for cute.
scheme@(guile-user)> (import (srfi srfi-26))
scheme@(guile-user)> (cute < 1 <> 2)
While compiling expression:
ERROR: Wrong number of arguments to #<procedure 10b5a4380 at language/cps/types.scm:724:0 (in succ a b)>
Thanks,
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#18604: master srfi-26 cute compile error
2014-10-02 12:14 bug#18604: master srfi-26 cute compile error Daniel Llorens
@ 2014-10-05 17:12 ` Mark H Weaver
2016-06-21 21:20 ` Andy Wingo
1 sibling, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2014-10-05 17:12 UTC (permalink / raw)
To: Daniel Llorens; +Cc: 18604
Daniel Llorens <daniel.llorens@bluewin.ch> writes:
> stable-2.0 with either cut or cute works. The compiler in master works for cut but not for cute.
>
> scheme@(guile-user)> (import (srfi srfi-26))
> scheme@(guile-user)> (cute < 1 <> 2)
> While compiling expression:
> ERROR: Wrong number of arguments to #<procedure 10b5a4380 at language/cps/types.scm:724:0 (in succ a b)>
The problem here is that the type analysis pass assumes that '<' takes
exactly two arguments. In common cases, this works out okay because the
earlier 'expand-primitives' pass has rules that convert uses of '<' into
chains of binary '<' operations. However, that only works when '<' is
in operator position at the time of the 'expand-primitives' pass. In
the case of 'cute', this is not the case:
scheme@(guile-user)> ,expand (cute < 1 <> 2)
$1 = (let ((t-86 2) (t-85 1) (t-84 <))
(lambda (t-96) (t-84 t-85 t-96 t-86)))
Then the partial evaluator does its thing:
scheme@(guile-user)> ,optimize (cute < 1 <> 2)
$2 = (lambda (t-113) (< 1 t-113 2))
and then the type analysis pass fails because its type-checkers and
type-inferrers for '<' (line 723 of language/cps/types.scm) assume that
it's a binary operation.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#18604: master srfi-26 cute compile error
2014-10-02 12:14 bug#18604: master srfi-26 cute compile error Daniel Llorens
2014-10-05 17:12 ` Mark H Weaver
@ 2016-06-21 21:20 ` Andy Wingo
1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2016-06-21 21:20 UTC (permalink / raw)
To: Daniel Llorens; +Cc: 18604-done
On Thu 02 Oct 2014 14:14, Daniel Llorens <daniel.llorens@bluewin.ch> writes:
> stable-2.0 with either cut or cute works. The compiler in master works for cut but not for cute.
>
> scheme@(guile-user)> (import (srfi srfi-26))
> scheme@(guile-user)> (cute < 1 <> 2)
> While compiling expression:
> ERROR: Wrong number of arguments to #<procedure 10b5a4380 at language/cps/types.scm:724:0 (in succ a b)>
Seems to be working in master. Please file a new report if you find a
bug. Cheers :)
Andy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-21 21:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 12:14 bug#18604: master srfi-26 cute compile error Daniel Llorens
2014-10-05 17:12 ` Mark H Weaver
2016-06-21 21:20 ` Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).