bug#18604: master srfi-26 cute compile error

2016-06-21 Thread Andy Wingo
On Thu 02 Oct 2014 14:14, Daniel Llorens  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 # 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





bug#18604: master srfi-26 cute compile error

2014-10-05 Thread Mark H Weaver
Daniel Llorens  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 # 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





bug#18604: master srfi-26 cute compile error

2014-10-02 Thread Daniel Llorens

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 #

Thanks,

Daniel