Discussion:
[Larceny-users] using srfi 27 and some other issues
Marijn Schouten (hkBst)
2009-02-28 18:28:17 UTC
Permalink
Hi larcenists,

I've been working on packaging larceny 0.97b1 for Gentoo, partly because I
wanted to try it out on a small physics simulation project that I'm working on.
I'd like to detail some of the difficulties I ran into.

in doc/UserManual there are a lot of files with names that end in ".txt" which
lead me to believe they were just plain text. Apparently they are something
else. Perhaps the misleading extension could be changed?

For example from doc/UserManual/compiling.txt:
proc:compile-file[args="sourcefile",optargs="faslfile"]
lead me to believe there was a procedure `proc:compile-file'.

Next when I tried to compile my file I got this:


Larceny v0.97b1 (beta test) (Feb 28 2009 17:48:48, precise:Linux:unified)
larceny.heap, built on za feb 28 17:49:32 CET 2009
(compile-file "ising.scm")
Error: get-datum: Lexical Error: Missing delimiter: -e #<INPUT PORT ising.scm>
Entering debugger; type "?" for help.
debug> #<EOF>
An error that I could not understand. It turns out I was using an illegal
function name starting with a hyphen: -energy/J-plus

I'm really non-plussed that such names are illegal, but at least the error
message should be much clearer and it would be great if it would include a line
number.

My program uses SRFI 27 (random sources) and so I added a "(require 'srfi-27)"
at the beginning. Then I got this:

$ larceny -nobanner -- ising.scm -e "(main 100)"


Error: Undefined global variable "srfi-9".
Entering debugger; type "?" for help.
debug>


So I changed that to "(require 'srfi-9) (require 'srfi-27)" but it makes no
difference.

Finally I would like to note that having to double ctrl-D to exit each repl is
very annoying. To quit the above invocation I have to ctrl-D 8 times.

I did not attach my code as I'm not sure that it would be appreciated/needed but
I can do so. It's 167 line according to wc.

Marijn

PS please CC me as I'm not on the list

- --
Sarcasm puts the iron in irony, cynicism the steel.

Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML
<http://www.gentoo.org/proj/en/lisp/>, #gentoo-{lisp,ml} on FreeNode
Jed Davis
2009-03-01 21:49:52 UTC
Permalink
Post by Marijn Schouten (hkBst)
My program uses SRFI 27 (random sources) and so I added a "(require 'srfi-27)"
$ larceny -nobanner -- ising.scm -e "(main 100)"
Error: Undefined global variable "srfi-9".
Entering debugger; type "?" for help.
debug>
So I changed that to "(require 'srfi-9) (require 'srfi-27)" but it makes no
difference.
Try "(require 'srfi-0) (require 'srfi-27)". The reason it's trying to
use srfi-9 as a variable is that the macro definition for cond-expand,
from SRFI 0, is missing; thus, the cond-expand form is treated as a
series of function applications and variables, of which the "srfi-9"
leaf is the first to be evaluated.
--
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l)))))) (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k))))))) '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))
William D Clinger
2009-03-05 12:23:25 UTC
Permalink
Post by Marijn Schouten (hkBst)
I've been working on packaging larceny 0.97b1 for Gentoo, partly
because I wanted to try it out on a small physics simulation project
that I'm working on. I'd like to detail some of the difficulties I
ran into.
Thank you for reporting these things to us.
Post by Marijn Schouten (hkBst)
in doc/UserManual there are a lot of files with names that end in
".txt" which lead me to believe they were just plain text. Apparently
they are something else. Perhaps the misleading extension could be
changed?
Those are AsciiDoc ( http://www.methods.co.nz/asciidoc/ )
input files. I don't know AsciiDoc well enough to know
whether the extension matters, but I'll look into it.
Those files are not included with binary versions of
Larceny; we include the HTML and PDF files produced from
those files instead.
Post by Marijn Schouten (hkBst)
An error that I could not understand. It turns out I was using an illegal
function name starting with a hyphen: -energy/J-plus
That has never been a legal identifier in Scheme, but
a lot of implementations fail to detect that error. The
R6RS requires implementations to raise exceptions for that
class of lexical error. For consistency, Larceny raises
those exceptions in all modes.
Post by Marijn Schouten (hkBst)
I'm really non-plussed that such names are illegal, but at least the
error message should be much clearer and it would be great if it would
include a line number.
The current development system reports the line number,
as will v0.97 when it is released.

A wholesale cleanup of Larceny's error messages is in
progress, but will take time.
Post by Marijn Schouten (hkBst)
My program uses SRFI 27 (random sources) and so I added a
$ larceny -nobanner -- ising.scm -e "(main 100)"
Error: Undefined global variable "srfi-9".
Entering debugger; type "?" for help.
debug>
As Larceny's R5RS mode is currently configured, you have to
(require 'srfi-0) before using cond-expand or requiring any
SRFIs that use cond-expand, directly or indirectly.

If that remains true in v0.97, then we should do a better
job of documenting it.
Post by Marijn Schouten (hkBst)
Finally I would like to note that having to double ctrl-D to
exit each repl is very annoying. To quit the above invocation
I have to ctrl-D 8 times.
That's odd. It may be OS-dependent, as I don't have to do
that. We'll look into it.

Thanks again for your bug reports.

Will

Loading...