Summary

Egg: Schelog Error: unbound variable: %set-of

Metadata

Attachments

Description

Details: After installing the Schelog egg, I began working through the documentation on the Schelog documentation site (http://ds26gte.github.io/schelog/index-Z-H-9.html). When I got to the %set-of descriptions, I found that my code choked on %set-of, though it works with %bag-of.

Code (loaded via emacs c-c, c-l, Chicken 4):

   (require-extension schelog)

   (define %knows
     (%rel ()
       [[('Odysseus|'TeX)]]
       [[('Odysseus|'Scheme)]]
       [[('Odysseus|'Prolog)]]
       [[('Odysseus|'Penelope)]]
       [[('Penelope|'TeX)]]
       [[('Penelope|'Prolog)]]
       [[('Penelope|'Odysseus)]]
       [[('Telemachus|'TeX)]]
       [[('Telemachus|'calculus)]]))

   (define %computer-literate
     (%rel (person)
       [(person)
         (%knows person 'TeX)
         (%knows person 'Scheme)]
       [(person)
         (%knows person 'TeX)
         (%knows person 'Prolog)]))

Program run (copied from REPL):

   #;4> (%which (list) (%let (x) (%bag-of x (%computer-literate x) list)))
   ((list (Odysseus Odysseus Penelope)))
   #;5> (%which (list) (%let (x) (%set-of x (%computer-literate x) list)))

   Error: unbound variable: %set-of

       Call history:

       <syntax>      (map370 (lambda363 (nam371 val372) (list373 nam371 (schelog:deref*368 val372))) (quote374 (list)) (l......
       <syntax>      (lambda363 (nam371 val372) (list373 nam371 (schelog:deref*368 val372)))
       <syntax>      (##core#lambda (nam371 val372) (list373 nam371 (schelog:deref*368 val372)))
       <syntax>      (##core#begin (list373 nam371 (schelog:deref*368 val372)))
       <syntax>      (list373 nam371 (schelog:deref*368 val372))
       <syntax>      (schelog:deref*368 val372)
       <syntax>      (quote374 (list))
       <syntax>      (##core#quote (list))
       <syntax>      (list373 list)
       <syntax>      (_376)
       <eval>      (_376)
       <eval>      (call-with-current-continuation362 (lambda363 (__qk364) (set!365 schelog:*more-k*366 __qk364) (set!3......
       <eval>      ((schelog:deref*368 (%let (x) (%set-of x (%computer-literate x) list))) (lambda363 (d369) (set!365 s......
       <eval>      (schelog:deref*368 (%let (x) (%set-of x (%computer-literate x) list)))
       <eval>      (_380)
       <eval>      (%set-of x (%computer-literate x) list)    <--
   #;5>

However, when I looked at the source code for the egg (on the web at http://code.call-cc.org/svn/chicken-eggs/release/4/schelog/trunk/schelog.scm) there was a %set-of define next to the %bag-of define.

   <snip code above>
   (define %bag-of (schelog:make-bag-of cons))
   (define %set-of (schelog:make-bag-of schelog:set-cons))
   <snip code below> 

I have not examined the local copy of the egg's source code on my system.

Version 4.9.0.1 (stability/4.9.0) (rev 8b3189b) linux-unix-gnu-x86-64 [[|64bit manyargs dload ptables ]] bootstrapped 2014-06-07

Schelog installed via chicken-install on 7/3/15. Thought to be 3.4

Changes and comments

[2015-07-04 15:58:58 UTC] bstrecker wrote:

During install of Schelog egg, a probably unrelated warning is generated regarding the (%more) function. (%more) operates as expected, however.

Transcript:

brian@linuxDev:~$ sudo chicken-install schelog [[sudo]|] password for brian: retrieving ... connecting to host "chicken.kitten-technologies.co.uk", port 80 ... requesting "/henrietta.cgi?name=schelog&mode=default" ... reading response ... HTTP/1.1 200 OK Date: Sat, 04 Jul 2015 13:45:54 GMT Server: Apache/2.2.29 (Unix) DAV/2 SVN/1.8.10 PHP/5.4.32 mod_fastcgi/2.4.6 Connection: close Transfer-Encoding: chunked Content-Type: text/plain reading chunks .. reading files ...

 ./schelog-module.scm
 ./schelog.meta
 ./schelog.scm
 ./schelog.setup
schelog located at /tmp/tempee06.26177/schelog

checking platform for `schelog' ... checking dependencies for `schelog' ... install order: ("schelog") installing schelog:3.4 ... changing current directory to /tmp/tempee06.26177/schelog

 '/usr/local/bin/csi' -bnq -setup-mode -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"schelog\" \"3.4\"))" 'schelog.setup'
 '/usr/local/bin/csc' -feature compiling-extension -setup-mode    -sJ -O3 -d1 schelog-module.scm -o schelog.so

Warning: in local unknown procedure,

 in toplevel procedure `schelog#%more':
 (schelog.scm:830) in procedure call to `schelog#schelog:*more-fk*', expected a value of type `(procedure (*) *)', but was given a value of type `symbol'
 '/usr/local/bin/csc' -feature compiling-extension -setup-mode    -s -O3 -d0 schelog.import.scm
 cp -r 'schelog.so' '/usr/local/lib/chicken/7/schelog.so'
 chmod a+r '/usr/local/lib/chicken/7/schelog.so'
 cp -r 'schelog.import.so' '/usr/local/lib/chicken/7/schelog.import.so'
 chmod a+r '/usr/local/lib/chicken/7/schelog.import.so'
 chmod a+r '/usr/local/lib/chicken/7/schelog.setup-info'

brian@linuxDev:~$

[2015-09-05 18:18:47 UTC] sjamaan attached schelog-1197.patch (description=Add %set-of to exported identifiers in module declaration)

[2015-09-05 18:20:38 UTC] sjamaan wrote:

I don't know anything about Schelog, but the definition of %more looks a bit iffy in that it sets schelog:*more-fk* at various points to a procedure, #f or one of the symbols forward or more. In any case, that's not why %set-of isn't working; it is simply omitted from the module declaration in schelog-module.scm. This is probably just an oversight. The attached patch fixes it.

[2015-09-06 00:07:04 UTC] felix changed status from new to closed

[2015-09-06 00:07:04 UTC] felix set resolution to fixed

[2015-09-06 00:07:04 UTC] felix wrote:

Thanks, Peter. Patch is applied and tagged 3.5

THe use of `schelog:*more-fk` certainly looks strange, but I never really understood the code - I just ported it.