GNU bug report logs - #18604
master srfi-26 cute compile error

Previous Next

Package: guile;

Reported by: Daniel Llorens <daniel.llorens <at> bluewin.ch>

Date: Thu, 2 Oct 2014 12:15:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mark H Weaver <mhw <at> netris.org>
To: Daniel Llorens <daniel.llorens <at> bluewin.ch>
Cc: wingo <at> pobox.com, 18604 <at> debbugs.gnu.org
Subject: bug#18604: master srfi-26 cute compile error
Date: Sun, 05 Oct 2014 13:12:30 -0400
Daniel Llorens <daniel.llorens <at> 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




This bug report was last modified 9 years and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.