[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
R6RS libraries: incorrect renaming of exported bindings?
From: |
Marco Maggi |
Subject: |
R6RS libraries: incorrect renaming of exported bindings? |
Date: |
Wed, 21 May 2014 09:38:58 +0200 |
Ciao,
on my x86_64-unknown-linux-gnu I have installed the distribution
package "guile-2.0.11.tar.gz", but, unless I am making a dumb mistake, I
get:
$ guile --version
guile (GNU Guile) 2.0.9
...
but this is not the problem. I am trying again to make the Infix
package[1] work with Guile; a previous version of the package was
working[2], but now I get other problems.
Notice that after configuring the package, without installing, from
the build directory we can:
$ make check
to run the full test suite,
$ make gtest
to run the tests with Guile only,
$ make grun
to enter Guile's REPL with configuration flags that allow loading the
Infix libraries.
Basically the package works:
$ make grun
export GUILE_LOAD_PATH=../lib:../tests; export
GUILE_WARN_DEPRECATED=detailed; guile -l ../tests/guile-r6rs-setup.scm
--no-auto-compile
GNU Guile 2.0.9
Copyright (C) 1995-2013 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)> (import (infix pratt))
scheme@(guile-user)> (infix sin(1))
$1 = 0.8414709848078965
scheme@(guile-user)> (infix atan(1 , 2))
$2 = 0.4636476090008061
scheme@(guile-user)> (infix 1 + 2 + 3)
$3 = 6
scheme@(guile-user)> (infix 1 + 2 * 3)
$4 = 7
scheme@(guile-user)> (infix 2 expt 3 expt 4)
$5 = 2417851639229258349412352
scheme@(guile-user)> (expt 2 (expt 3 4))
$6 = 2417851639229258349412352
scheme@(guile-user)> (infix - 5)
$7 = -5
scheme@(guile-user)> (infix 5 factorial)
$8 = 120
scheme@(guile-user)> (factorial 5)
$9 = 120
where FACTORIAL is a procedure exported by (infix pratt) and it is
recognised by INFIX as postfix operator. The library (infix pratt)
exports ! (which is the bang symbol) as an alias for FACTORIAL; this
alias is not recognised by INFIX:
scheme@(guile-user)> (infix 5 !)
While compiling expression:
ERROR: ERROR: R6RS exception:
1. &who: infix
2. &message: "expected matching right parenthesis"
3. &syntax:
form: #(syntax-object (infix 5 !) ((#f top) shift) (hygiene
guile-user))
subform: #<r6rs:record:<operand>>
similarly:
scheme@(guile-user)> (infix 10 mod 3)
$10 = 1
scheme@(guile-user)> (infix 10 % 3)
While compiling expression:
ERROR: ERROR: R6RS exception:
1. &who: infix
2. &message: "expected matching right parenthesis"
3. &syntax:
form: #(syntax-object (infix 10 % 3) ((#f top) shift) (hygiene
guile-user))
subform: #<r6rs:record:<operand>>
the problem is that:
scheme@(guile-user)> (import (infix pratt))
scheme@(guile-user)> (free-identifier=? #'factorial #'!)
$1 = #f
scheme@(guile-user)> (free-identifier=? #'mod #'%)
$2 = #f
while the identifiers should be FREE-IDENTIFIER=?.
This is not the first time I have problems with FREE-IDENTIFIER=?[3],
but probably this is something else.
TIA
[1] <http://github.com/marcomaggi/infix/>
[2] <http://lists.gnu.org/archive/html/guile-user/2010-06/msg00089.html>
[3] <http://lists.gnu.org/archive/html/guile-user/2011-02/msg00069.html>
--
"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- R6RS libraries: incorrect renaming of exported bindings?,
Marco Maggi <=