[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] functor support
From: |
Jörg F . Wittenberger |
Subject: |
[Chicken-hackers] functor support |
Date: |
08 Sep 2018 19:11:45 +0200 |
Hi Chickeneers,
attached is a test trying to package the functor example from the
documentation as an egg. This is no good except to showcase some issues.
1. "include" should be expanded. (I reported this before, now here is
the simple example.)
2. Line numbers for errors refer to an unexpected location: all blame
is assigned to the instatiation line. (This is rather annoying for me.)
Following the details
Best
/Jörg
Do not install this egg, just do `chicken-install -n` reproduce the
situation.
After compilation try:
1.A) Run the test (The error in (*) is expected.)
functor$ csi tests/run.scm
CHICKEN
(c) 2008-2018, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.0.0rc1 (prerelease) (rev 9d480412)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
; loading tests/run.scm ...
; loading ./squaring-functor.import.so ...
; loading ./squaring-functor.so ...
; including functor-code.scm ...
Error: (*) bad argument type - not a number: #f
1.B)
functor$ pushd tests
functor/tests$ csi
CHICKEN
(c) 2008-2018, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.0.0rc1 (prerelease) (rev 9d480412)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
#;1> (load "../squaring-functor.so")
; loading ../squaring-functor.so ...
#;2> (load "../squaring-functor.import.scm")
; loading ../squaring-functor.import.scm ...
#;3> (module nums (multiply)
(import scheme)
(define (multiply x y) (* x y)))
#;4> (module number-squarer = (squaring-functor nums))
Error: (include) cannot open file: "functor-code.scm"
2.) Open squaring-functor.scm, comment out line 7 and remove the
comment from line 8.
Again do
$ chicken-install -n
functor$ csc tests/run.scm
functor$ ./tests/run
Error: (*) bad argument type - not a number: #f
Call history:
tests/run.scm:1: chicken.load#load-extension
tests/run.scm:3: ##sys#register-compiled-module
tests/run.scm:7: ##sys#register-compiled-module
tests/run.scm:10: number-squarer#square
tests/run.scm:7: nums#multiply
tests/run.scm:13: number-squarer#square
tests/run.scm:7: nums#multiply
Compare to tests/run.scm line 7 is:
(module number-squarer = (squaring-functor nums))
functor.tar.gz
Description: functor.tar.gz
- [Chicken-hackers] functor support,
Jörg F . Wittenberger <=