johnwcowan / cpscm Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/cpscm
License: GNU General Public License v2.0
Automatically exported from code.google.com/p/cpscm
License: GNU General Public License v2.0
hi
this might be a bug:
echo "(cadr '(define (f x)) )" > t.sc
echo '(scm2scm:compile "t.sc" "tt.sc")' | sisc scm2scm.scm
SISC (1.16.6)
#;> Error: (no expressions in body ())
---------------------------
To enable more detailed stack tracing, set the dynamic parameter
max-stack-trace-depth to a non-zero value, e.g. 16.
---------------------------
Some stack trace entries may have been suppressed. To see all entries set
the dynamic parameter suppressed-stack-trace-source-kinds to '().
#;>
Original issue reported on code.google.com by [email protected]
on 27 Aug 2008 at 1:30
I use chicken. This bug should be replicable using SISC in the same way.
Run chicken in the <checkout-root>/cpscm-read-only/scm directory as follows:
$ csi danm/chicken-prelude.scm cpscm.scm
At the REPL try:
#;1> (define exp '(lambda (foo) ((lambda (bar) (if (= bar 0) 0 (+ foo
foo))) foo)))
#;2> (simplify-sexp exp)
=> (lambda (bar) (if (= bar 0) 0 (+ foo foo)))
Because the second lambda in exp is a closure which captures the binding to
foo, the expression cannot be simplified and the expected output is exp
unchanged.
The problem may be that the computation? routine returns false for lambda
and define expressions. The attached patch fixes the problem for all the
cases I tried. I have not fully grokked the simplification code, however,
so this is a quick fix that almost certainly prevents other valid
simplifications.
This bug affects all the output backends for cpscm. I have actual practical
scheme code that will not properly compile with cpscheme before the
application of the patch.
Original issue reported on code.google.com by [email protected]
on 14 Aug 2008 at 8:12
Attachments:
Hi
I've got cpscm compiled without problem,
but the first sample code I tried gives this error:
echo '(define list-index (lambda (pred lst)
(call/cc (lambda (return)
(for-each (lambda (i x)
(if (pred x) (return i))
) (idx-interval lst) lst)
#f))))' > t.sc
echo '(import scm2scm)(scm2scm:compile "t.sc" "tt.sc")' |
csi -q danm/chicken-prelude.scm cpscm.scm
; visiting scm2scm.scm ...
Error: unbound variable: 14598332513316644$$scm2scm:compile
NOTE: (import scm2scm) was evaluated OK
what I did wrong?
Thanks
Original issue reported on code.google.com by [email protected]
on 26 Aug 2008 at 4:30
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.