[Chicken-users] my errors with eval

2013-07-02 Thread Daniel Ajoy

Hi,

Both this

(let ((a 1) )
  (define (inc)
(set! a (+ 1 a ) ) )
  (define (runTwice op )
(op)
(op) )
  (eval '(runTwice inc ) )
  )

and this

(let* ((a 1) )
  (define (inc)
(set! a (+ 1 a ) ) )
  (define (runTwice op )
(op)
(op) )
  (eval '(runTwice inc ) )
  )

Give me the error:

Error: unbound variable: runTwice

I'm defining runTwice right before running the eval. What am I not 
understanding?

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] representation of a procedure

2013-06-27 Thread Daniel Ajoy

Hi,

Is there a function that gives the content of a procedure (it's definition)?

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] dynamic scoping

2013-06-26 Thread Daniel Ajoy

"add" binds a to 1 at the moment of definition.

#;48> (define a 1)
#;49> (define (add x) (+ x a) )
#;50> (add 10)
11
#;51> (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of "a" to add, so that, something like 
this happens:

(let ((a 100) ) (add 10) )
110

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Error: unbound variable: define-macro

2013-06-25 Thread Daniel Ajoy

I pasted this code:

(define-macro (ez-debug var)
(let ((name (symbol->string var)))
  `(print ,name ": " ,var)))


from

http://wiki.call-cc.org/chicken-for-ruby-programmers#macros

and got

Error: unbound variable: define-macro

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] bugs can be corrected live

2013-06-18 Thread Daniel Ajoy

Hi,

Here

http://wiki.call-cc.org/elevator-pitch

it says this:

"An excellent maintenance environment; bugs can be corrected live, without 
restarting a single process."

where can I find more information about that?

I think that page should have links to the pages where those things are 
explained.

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] pressed Ctrl-\ and got segmentation fault

2013-06-17 Thread Daniel Ajoy


This is my .csirc

(use readline irregex)
(current-input-port (make-gnu-readline-port))
(gnu-readline-parse-and-bind "set editing-mode vi")
(gnu-history-install-file-manager
 (string-append (or (get-environment-variable "HOME") ".") "/.chicken_history")
 )

csi

CHICKEN
(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.0.3 (stability/4.8.0) (rev 091c3d9)
windows-cygwin-x86 [ manyargs dload ptables ]
compiled 2013-03-12 on aeryn.xorinia.dim (Darwin)

I press Ctrl-\

and I get

#;1> ^\Segmentation fault (core dumped)

why?

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] scheme.vim

2013-06-17 Thread Daniel Ajoy

the file

Vim\vim73\ftplugin\scheme.vim

has this:

==

if exists("b:is_chicken") || exists("is_chicken")
" improve indenting
setl iskeyword+=#,%,^
setl lispwords+=let-optionals,let-optionals*,declare
setl lispwords+=let-values,let*-values,letrec-values
setl 
lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case
setl lispwords+=cond-expand,and-let*,foreign-lambda,foreign-lambda*
endif

==

But http://wiki.call-cc.org/vim#using-gnu-screen

has this different list:


setl lispwords+=let-values,condition-case,with-input-from-string
setl lispwords+=with-output-to-string,handle-exceptions,call/cc,rec,receive
setl lispwords+=call-with-output-file

which one is more up to date?

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] define rec

2013-06-14 Thread Daniel Ajoy

Hi,

I'm new to Scheme

when I type

(define rec (lambda (n) (if (= n 0 ) "oops!" (/ 1 n ) ) ) )

The procedure seems to be accepted

But when I do:

(rec 1)

I get:

Error: (cadr) bad argument type: ()

Call history:

  (rec 1)
  (##core#letrec ((1)) 1)   <--

Why is that?

Daniel

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users