Re: [Chicken-users] load printout

2007-12-20 Thread minh thu
19 Dec 2007 17:11:05 -0200, Mario Domenech Goulart <[EMAIL PROTECTED]>:
> Hi Rick,
>
> On Wed, 19 Dec 2007 12:18:36 -0600 Rick Taube <[EMAIL PROTECTED]> wrote:
>
> > is it possible to silently load a file, ie to not get any message
> > printed to the terminal during the load?
> >
> > #;1> (load "aaa.scm")
> > ; loading aaa.scm ...
>
> Yes, with the load-verbose parameter:
> http://chicken.wiki.br/Parameters#load-verbose
>
> Example:
>
> #;1> (load-verbose #f)

Somewhat related : try also csi -q
mt


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


[Chicken-users] Re: Debian slander?

2007-12-20 Thread Tobia Conforto
Robin Lee Powell wrote:
> http://packages.debian.org/sid/chicken-bin
>
> It certainly seems production quality and decently performant to me;
> does the Chicken community still agree with the statements there?

I find them biased and misleading.  Those statements, coupled with the
maintainer's laziness in updating the packages, are probably turning
quite a few people away from Chicken.  Either he is acting in bad faith,
or he's lost interest in it.  In any case I would welcome a change.


Tobia


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


[Chicken-users] how to use define-macro to...

2007-12-20 Thread minh thu
Hi,

1/
I'd like to "repeat" this code for a lot of operators (not just + as
in the following).
How can I do that ?

(define old+ +)
(define (+ a b)
  (if (or (instance-of? a ) (instance-of? b ))
(create-behavior (list a b) old+)
(old+ a b)))

The problem is how to capture the old + (as old+) to use it in the redefinition.

2/
I could write the following at any place I want to print debug info.

(cond-expand
  (debug-behaviors (printf "Debugging...~N"))
  (else)

Note the particular symbol debug-behaviors.

But it's boring; I would prefer have a "debug" macro instead :

(debug
  (printf "Debugging...~N"))

But I don't know how I can make it expends to nothing as in the else
clause of the
cond-expand. I use this :

(define-macro (debug rest)
  (cond-expand
(debug-behaviors rest)
(else '(noop

I have to use the noop procedure.

Also, can I write a "higher" macro to generate the "debug" one with a
particular debug-something symbol ?

Thanks,
mt


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


Re: [Chicken-users] how to use define-macro to...

2007-12-20 Thread Alex Shinn
On Dec 20, 2007 8:35 PM, minh thu <[EMAIL PROTECTED]> wrote:
>
> 1/
> I'd like to "repeat" this code for a lot of operators (not just + as
> in the following).

(define-syntax shadow
  (syntax-rules ()
((shadow op old-op)
 (begin
  (define old-op op)
  (define (op a b)
(if (or (instance-of? a ) (instance-of b? ))
(create-behavior (list a b) old-op)
(old-op a b)))

(shadow + old+)
(shadow - old-)
(shadow * old*)
... etc.

That's if you want the old operator visible - you could also use a temp.

> 2/
>
> But it's boring; I would prefer have a "debug" macro instead :

(define-syntax eval-when-defined
  (syntax-rules ()
((eval-when-defined sym expr)
 (cond-expand (sym expr) (else (noop))

(define-syntax debug
  (syntax-rules ()
((debug expr)
 (eval-when-defined debug-behaviors expr

define-macro is fundamentally broken.

And for these types of macros syntax-rules is actually
simpler - you're just dealing with templates.

-- 
Alex


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


Re: [Chicken-users] how to use define-macro to...

2007-12-20 Thread Alex Sandro Queiroz e Silva

Hallo,

minh thu escreveu:

Hi,

1/
I'd like to "repeat" this code for a lot of operators (not just + as
in the following).
How can I do that ?

(define old+ +)
(define (+ a b)
  (if (or (instance-of? a ) (instance-of? b ))
(create-behavior (list a b) old+)
(old+ a b)))

The problem is how to capture the old + (as old+) to use it in the redefinition.
  


(define-macro (add-behavior op)
 (let ((old (gensym))
   (new (gensym)))
   `(let ((,old ,op)
  (,new (lambda (a b)
  (if (or (instance-of? a ) (instance-of? b 
))

  (create-behavior (list a b) ,old)
  (,old a b)
  (set! ,op ,new


2/
I could write the following at any place I want to print debug info.

(cond-expand
  (debug-behaviors (printf "Debugging...~N"))
  (else)

Note the particular symbol debug-behaviors.

But it's boring; I would prefer have a "debug" macro instead :

(debug
  (printf "Debugging...~N"))

But I don't know how I can make it expends to nothing as in the else
clause of the
cond-expand. I use this :

(define-macro (debug rest)
  (cond-expand
(debug-behaviors rest)
(else '(noop

I have to use the noop procedure.

Also, can I write a "higher" macro to generate the "debug" one with a
particular debug-something symbol ?
  


(cond-expand
 (debug-behaviors (define debugging-behaviors? #t))
 (else (define debugging-behaviors? #f)))

(define-macro (debug . args)
 (when debugging-behaviors?
   `(apply print ,args)))


I hope this helps, it's not tested :-)

Cheers,
-alex



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


Re: [Chicken-users] Friendlier Chicken for Win32

2007-12-20 Thread felix winkelmann
On Dec 20, 2007 1:08 AM, Shawn Rutledge <[EMAIL PROTECTED]>
wrote:

>
> It would also be nice to have a binary distribution like this which
> works with the MSVC compiler.  But that would require writing an
> nmake-compatible makefile.
>

But why would you need a makefile, if you already have the binary distribution?


cheers,
felix


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


Re: [Chicken-users] Re: Debian slander?

2007-12-20 Thread felix winkelmann
On Dec 20, 2007 11:50 AM, Tobia Conforto <[EMAIL PROTECTED]> wrote:
> Robin Lee Powell wrote:
> > http://packages.debian.org/sid/chicken-bin
> >
> > It certainly seems production quality and decently performant to me;
> > does the Chicken community still agree with the statements there?
>
> I find them biased and misleading.  Those statements, coupled with the
> maintainer's laziness in updating the packages, are probably turning
> quite a few people away from Chicken.  Either he is acting in bad faith,
> or he's lost interest in it.  In any case I would welcome a change.
>

I actually contacted the maintainer a while ago asking for a change
of the description - AFAIK he wanted to do that but perhaps he forgot.


cheers,
felix


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


Re: [Chicken-users] Friendlier Chicken for Win32

2007-12-20 Thread Alex Sandro Queiroz e Silva

Hallo,

Shawn Rutledge escreveu:

On Dec 19, 2007 2:10 PM, Alex Sandro Queiroz e Silva <[EMAIL PROTECTED]> wrote:
  

 Based on my previous (program-filename) patch, I have created a
chicken dist for win32 that can be dropped anywhere. csc automatically
finds the Chicken compiler, includes and libs. This package may make the
life of first-time Chicken users easier. It is in [1].

[1] - http://www.ventonegro.org/chicken/



I tried it, it looks useful!

I have cygwin installed.  If I compile a "hello world" from a DOS
prompt, the result doesn't produce output:
  


That's weird. Do you have Mingw as well as Cygwin? If not, maybe 
the Cygwin runtime has problems outputting to Windows command prompts.



Cheers,
-alex



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


[Chicken-users] Question SRFI-56

2007-12-20 Thread Siegfried Gonzi
Hello:

I am still evaluating the case with reading binary data files. However, I do 
not understand the following srfi-56 comment:

==
The reference implementation has been tested with the following Schemes: 
Bigloo, Chez, Chicken, Gambit, Gauche, Guile, Kawa, KSI, MIT-Scheme, MzScheme, 
RScheme, Scheme48, SISC and Stklos. The *-float64 code turns out to be a very 
rigorous stress test for an implementation's numeric code. At time of writing, 
Chicken 2.0 (with the optional numbers egg), KSI 3.4.2 and MzScheme (both 200 
and 299 versions) are currently the only implementations to pass all tests. 
Petite Chez 6.0a is the next most complete failing 6, followed by Gambit4b14 
failing 8. Any Scheme that implements floating point numbers internally as C 
floats rather than doubles will be fundamentally unable to pass all *-float64 
tests.
==


Does that mean Bigloo implements numbers as C float type rather than double 
precision? Same for Gambit-C?

Chicken implements numbers as double precision?

I always thought there are two types for most of the 'modern languages' (e.g. 
Clean which I first learnt and  Scheme compilers): long integer, and double 
precision C type?


Anyone any experience with srfi-56 on Chicken. I think it never went through 
the peer review process and has been withdrawn. But anyway.

Thanks, Siegfried

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger?did=10


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


[Chicken-users] Re: Question SRFI-56

2007-12-20 Thread felix winkelmann
On Dec 20, 2007 6:05 PM, Siegfried Gonzi <[EMAIL PROTECTED]> wrote:
>
> Chicken implements numbers as double precision?

fixnums (31-bit signed integers on 32 bit platforms, or 65-bit on
64-bit platforms) and flonums (64 bit double precision floats).


cheers,
felix


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


Re: [Chicken-users] Friendlier Chicken for Win32

2007-12-20 Thread Shawn Rutledge
On Dec 20, 2007 7:49 AM, Alex Sandro Queiroz e Silva <[EMAIL PROTECTED]> wrote:
> > I have cygwin installed.  If I compile a "hello world" from a DOS
> > prompt, the result doesn't produce output:
>
>  That's weird. Do you have Mingw as well as Cygwin? If not, maybe

No.

> the Cygwin runtime has problems outputting to Windows command prompts.

Usually stdout doesn't seem to work with Windows programs.  E.g. if
you follow the usual wizard process to create a new Windows GUI
program in MS Visual Studio, and then decide you'd like to use printf
to do some debugging, it doesn't work without redirecting stdout
somewhere useful (either to the window from which you run it, or have
the app create its own logging window and redirect there).  OS/2 used
to be the same way.  I don't understand why they did that, but it's
probably not a bug.  But maybe mingw does this extra work for you
(redirects output so that stdout will be functional already).


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


[Chicken-users] Re: Question SRFI-56

2007-12-20 Thread felix winkelmann
On Dec 20, 2007 6:17 PM, felix winkelmann <[EMAIL PROTECTED]> wrote:
> On Dec 20, 2007 6:05 PM, Siegfried Gonzi <[EMAIL PROTECTED]> wrote:
> >
> > Chicken implements numbers as double precision?
>
> fixnums (31-bit signed integers on 32 bit platforms, or 65-bit on
> 64-bit platforms) and flonums (64 bit double precision floats).

63-bit on 64-bit platforms. Sorry.

(thanks to Lars Nilsson)


cheers,
felix


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


[Chicken-users] Re: Question SRFI-56

2007-12-20 Thread felix winkelmann
On Dec 20, 2007 6:27 PM, felix winkelmann <[EMAIL PROTECTED]> wrote:
>
> On Dec 20, 2007 6:17 PM, felix winkelmann <[EMAIL PROTECTED]> wrote:
> > On Dec 20, 2007 6:05 PM, Siegfried Gonzi <[EMAIL PROTECTED]> wrote:
> > >
> > > Chicken implements numbers as double precision?
> >
> > fixnums (31-bit signed integers on 32 bit platforms, or 65-bit on
> > 64-bit platforms) and flonums (64 bit double precision floats).
>
> 63-bit on 64-bit platforms. Sorry.
>
> (thanks to Lars Nilsson)
>

everyone better just ignores me...


cheers,
felix


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


Re: [Chicken-users] Friendlier Chicken for Win32

2007-12-20 Thread Shawn Rutledge
On Dec 20, 2007 6:17 AM, felix winkelmann <[EMAIL PROTECTED]> wrote:
> On Dec 20, 2007 1:08 AM, Shawn Rutledge <[EMAIL PROTECTED]>
> wrote:
>
> >
> > It would also be nice to have a binary distribution like this which
> > works with the MSVC compiler.  But that would require writing an
> > nmake-compatible makefile.
> >
>
> But why would you need a makefile, if you already have the binary 
> distribution?

If chicken has been compiled with the MS compiler, then csc should
know to use the ms compiler rather than gcc when compiling Scheme
programs.  Or, say you want to compile Chicken yourself, but you
haven't got mingw.  And to generate the alternative binary version of
Chicken which has been compiled with the MS compiler, you need a
makefile or a vcproj file to do that.

Aren't there some incompatibilities?  I never tried to link a program
compiled with one compiler with an object or a lib compiled with the
other.  But maybe that's possible.  Then csc would just have to be
told which compiler to use, or discover it at runtime.


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


[Chicken-users] Re: Question SRFI-56

2007-12-20 Thread Siegfried Gonzi
I downloade numbers and srfi-56. But I get the following error when using 
srfi-56 and there is no specific comment in the source code:

==
siegfried-gonzis-macbook:test sgonzi$ csc srfi-56-test.scm 
Warning: can not represent exact fraction - coerced to flonum in line 154
"1/3"
Warning: can not represent exact fraction - coerced to flonum in line 164
"1/3"
Warning: can not represent exact fraction - coerced to flonum in line 215
"1/3"
Warning: can not represent exact fraction - coerced to flonum in line 224
"1/3"
Syntax error: define-syntax

"highlevel macros are not supported"

Expansion history:

(lambda (size position n) (bitwise-and 
(bitwise-not (arithmetic-shift -1 size)) (arithmetic-shift n...
(begin (bitwise-and (bitwise-not 
(arithmetic-shift -1 size)) (arithmetic-shift n (- position
(bitwise-and (bitwise-not (arithmetic-shift -1 
size)) (arithmetic-shift n (- position)))
(bitwise-not (arithmetic-shift -1 size))
(arithmetic-shift -1 size)
(arithmetic-shift n (- position))
(- position)
(define-syntax let-params* (syntax-rules () ((_ 
ls () . body) (let () . body)) ((_ ls ((var default...  <--
*** Shell command terminated with exit status 1: /usr/local/bin/chicken 
srfi-56-test.scm -output-file srfi-56-test.c -quiet
==

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger?did=10


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


Re: [Chicken-users] Reading binary files

2007-12-20 Thread Shawn Rutledge
On Dec 18, 2007 3:41 AM, Siegfried Gonzi <[EMAIL PROTECTED]> wrote:
> Is there an easy way in Chicken to read binary files? I have got binary files 
> created on my desktop Linux

I have used the endian-port egg for reading and writing binary stuff.

http://www.call-with-current-continuation.org/eggs/endian-port.html


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


Re: [Chicken-users] Re: Question SRFI-56

2007-12-20 Thread John Cowan
Siegfried Gonzi scripsit:

> siegfried-gonzis-macbook:test sgonzi$ csc srfi-56-test.scm 

Just downloading the egg does not load it into the compiler.  You need
to download syntax-case as well, and then put "(use numbers) (use syntax-case)"
at the top of the file, or use the equivalent csc options.

> Warning: can not represent exact fraction - coerced to flonum in line 154
> "1/3"

That is a sign that the numbers egg is not loaded.

> Syntax error: define-syntax
> 
>   "highlevel macros are not supported"

And that is a sign that syntax-case is not loaded.

-- 
I now introduce Professor Smullyan, John Cowan
who will prove to you that either   [EMAIL PROTECTED]
he doesn't exist or you don't exist,http://www.ccil.org/~cowan
but you won't know which.   --Melvin Fitting


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


Re: [Chicken-users] Re: Question SRFI-56

2007-12-20 Thread Alex Shinn
On Dec 21, 2007 5:04 AM, Siegfried Gonzi <[EMAIL PROTECTED]> wrote:
> I downloade numbers and srfi-56. But I get the following error when using 
> srfi-56 and there is no specific comment in the source code:
>
> ==
> siegfried-gonzis-macbook:test sgonzi$ csc srfi-56-test.scm

That should be

  csi -R syntax-case -R numbers srfi-56-test.scm

(or -R syntactic-closures instead of -R syntax-case).

Bigloo failed the tests because it doesn't support bignums - because
of that I believe it had the worse result of any implementation.

SRFI-56 did go through a peer review - that's what the SRFI process
is.  The reason for the withdrawal was explained on the list.  As a library
of binary parsing utilities it was fine, but I felt it failed to
adequately address
the distinction between binary and textual files, and I didn't want to
encourage people to build on a non-solid foundation.

-- 
Alex


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