[Chicken-users] crazy behaviour in csi!

2005-12-05 Thread Sunnan
#;31 (define rec itrec)
#;32 ((rec zero? 1 * sub1) 6)
Error: during expansion of (letrec ...) - (letrec) unexpected object:
((zero? 1 * sub1))
#;32 (eq? rec itrec)
#t
#;33 ((rec zero? 1 * sub1) 6)
Error: during expansion of (letrec ...) - (letrec) unexpected object:
((zero? 1 * sub1))
#;33 ((itrec zero? 1 * sub1) 6)
720
#;34 

itrec and rec are the same, but one makes error and the other doesn't.
csi -version
Version 2, Build 214 - linux-unix-gnu-unknown - [ dload ptables ]

Chicken and csi is from darcs repo a couple of days ago.

; This is the definition of itrec

(define (itrec break start do inc)
  (lambda (x)
(let loop ((x x) (total start))
  (if (break x)
  total
  (loop (inc x) (do x total))

;; and this is the definition of rec that I originally wanted to have,
;; but the behaviour is as crazy regardless of what rec does.
;; even with (define rec itrec) it becomes crazy!
;; or with (define rec list) or define rec anything, anything!

(define (rec break fin do inc)
  (lambda (x)
(let loop ((x x))
  (if (break x)
  fin
  (do x (loop (inc x)))


I wanted to make an implementation of the idea in near the bottom of
http://www.paulgraham.com/power.html

help!
years truely,
sunnan



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


[Chicken-users] Chicken mode for Emacs?

2005-12-05 Thread Ralph Moritz
Hi everyone,

is there an Emacs mode available that will run csi as
an inferior Emacs process (preferably with syntax
highlighting)? Starting csi from eshell isn't so cool...

Regards,
Ralph

--
Ralph A. Moritz
``Syntactic sugar causes cancer of the semi-colon''


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


Re: [Chicken-users] Chicken mode for Emacs?

2005-12-05 Thread Thomas Chust

On Mon, 5 Dec 2005, RalphMoritz wrote:


[...]
is there an Emacs mode available that will run csi as
an inferior Emacs process (preferably with syntax
highlighting)? Starting csi from eshell isn't so cool...
[...]


Hello,

standard Emacs distributions usually include support for starting an 
inferior Scheme process using the run-scheme interactive lisp function.


You can set the program that will be launched by that function through the 
customizable variable scheme-program-name.


cu,
Thomas


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


Re: [Chicken-users] crazy behaviour in csi!

2005-12-05 Thread Thomas Chust

On Mon, 5 Dec 2005, Sunnan wrote:


#;31 (define rec itrec)
#;32 ((rec zero? 1 * sub1) 6)
Error: during expansion of (letrec ...) - (letrec) unexpected object:
[...]


Hello,

I would say this is expected behaviour, because rec is bound in macro 
transformer space -- see http://srfi.schemers.org/srfi-31/srfi-31.html for 
a description of what it does.


If you absolutely must use rec as a name for something different, try 
unbinding the macro using

  (undefine-macro! 'rec)

cu,
Thomas


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


Re: [Chicken-users] Chicken mode for Emacs?

2005-12-05 Thread Mario Domenech Goulart
Hello Ralph

On Mon, 5 Dec 2005 11:35:42 +0200 Ralph Moritz [EMAIL PROTECTED] wrote:

 is there an Emacs mode available that will run csi as
 an inferior Emacs process (preferably with syntax
 highlighting)? Starting csi from eshell isn't so cool...

I use Neil's Quack (http://www.neilvandyke.org/quack).  Works fine for
me.  You can choose the Scheme interpreter you want to use (Quack -
Options - Default Program) then you just need to M-x run-scheme.

Best wishes,
Mario


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


Re: [Chicken-users] Chicken mode for Emacs?

2005-12-05 Thread Raffael Cavallaro
On Dec 5, 2005, at 4:35 AM, Ralph Moritz wrote:is there an Emacs mode available that will run csi as an inferior Emacs process (preferably with syntax highlighting)? I use Quack which is at http://www.neilvandyke.org/quack/regards,Ralph Raffael Cavallaro, Ph.D. [EMAIL PROTECTED]  ___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Re: Chicken mode for Emacs?

2005-12-05 Thread Trent Buck
Ralph Moritz [EMAIL PROTECTED] writes:

 Hi everyone,

 is there an Emacs mode available that will run csi as
 an inferior Emacs process (preferably with syntax
 highlighting)? Starting csi from eshell isn't so cool...

C-u M-x run-scheme RET csi RET

Or eval
  (setq scheme-program-name csi)

and then simply use M-x run-scheme RET.

-- 
Trent Buck, Student Errant



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