Re: [Chicken-users] my first chicken 4 modules ;)

2008-05-28 Thread felix winkelmann
On Wed, May 28, 2008 at 1:58 AM, Jim Ursetto [EMAIL PROTECTED] wrote:
 I also managed to port vector-lib.egg over.

 Minor issues encountered during the port:

 1) Warnings aren't issued for unbound identifiers -- I spent a while
   tracking down a weird error and it turns out I forgot to import
   'when' from chicken, along with numerous runtime failures when I
   forgot to import procedures.  Some of that is inexperience.  But
   the analogue of -check-imports would be nice.  I guess once this is
   more mature then consistent import library data would be usable for
   this role.

It should indeed be possible to warn in this case. I'll think of something.

 2) Throw something like (display foobar), where foobar is unbound,
   into your module and at runtime it will actually display #unbound
   value without throwing an error.  If a procedure is unbound, it
   similarly complains about 'Error: call of non-procedure: #unbound
   value' but this is easily tracked down using the call history.

How can I reproduce this? I get a proper error message.

 3) Importing and then redefining an R5RS binding, such as
   list-vector, inside a module results in 'Warning: exported
   variable multiply defined' and also overwrites the toplevel binding
   as soon as you link in the extension with (use).  To avoid this
I did the following:

 (import (except scheme list-vector vector-list vector-fill!)
(prefix (only scheme list-vector vector-list vector-fill!)
%))

   and then used %list-vector as the core version.  This worked
   fine.  But I'm not sure if it's correct.


I'm not sure how to handle this. Importing bindings does not
introduce module-local bindings on redefinition, as it does
in many other module systems. I have added a note to
the manual about this.


cheers,
felix


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


Re: [Chicken-users] libsvm egg install problem

2008-05-28 Thread Daishi Kato
Hi,

I've updated the egg (v1.1), which hopefully works fine.
Please give it a try.

I've been testing against debian libsvm package.
--daishi

At Tue, 27 May 2008 12:50:13 -0700,
Tom Poliquin wrote:
 
 I'm trying to install the libsvm egg and not
 having much success.
 
 The libsvm egg requires the libsvm library.
 
 I downloaded the only libsvm library I could find from
 http://www.csie.ntu.edu.tw/~cjlin/libsvm/
 (libsvm-2.86) which after installation only generates an svm.o.
 I tried some older versions hoping to find one generating an 'so'
 file but was unsuccessful.
 
 Undaunted, (and not an shared library expert) I did this ..
 g++ -fPIC -Wall -O3 -c svm.cpp
 ld -shared -soname libsvm.so.1 -o libsvm.so.1.0 -lc svm.o
 
 I then moved the .so into my ~/lib directory with appropriate
 symbolic links ..
 libsvm.so.1.0
 libsvm.so.1 - libsvm.so.1.0
 libsvm.so - libsvm.so.1.0
 and ran ldconfig
 
 I then ran the egg install (I'm using
 Chicken 3.1.0) and got ..
 
   The extension libsvm does not exist.
   Do you want to download it ? (yes/no/abort) [yes] yes
   downloading libsvm.egg from (www.call-with-current-continuation.org eggs/
   3 80) .
   gzip -d -c /tmp/chicken-setup-3-cowboyneal/downloads/libsvm.egg | tar xf -
/home/cowboyneal/bin/csc -feature compiling-extension -s -O2 libsvm.scm
   Warning: extension `libsvm_core' is currently not installed
   /home/cowboyneal/bin/csc 
-feature compiling-extension -s -O2 libsvm_core.scm l
   ibsvm_core_wrap.c -lsvm -I/usr/include/libsvm-2.0/libsvm
   Error: unbound variable: documentation
 
 Looks like I also need a libsvm_core.so .. I'm guessing I haven't
 downloaded the right libsvm .. ?
 
 Any thoughts greatly appreciated,
 
 Tom
 
 
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/chicken-users
 
 **
  XREA.COM -Free Web Hosting-
  http://www.xrea.com/
 **


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


[Chicken-users] miscmacros hygienic

2008-05-28 Thread Jim Ursetto
I ported miscmacros (attached) to the hygienic branch and had a couple
questions.

First, is anyone using miscmacros?  I was wondering about the following
proposed change to the anaphoric macros:

Current - Proposed
(if* x y z) - (if* (it x) y z)
(while* test body)  - (while* (it test) body)
(repeat* test body) - (repeat* (it test) body)

I think it's nicer not to break hygiene by introducing a hidden 'it'
identifier--like dotimes does not.  In the port I actually implemented them
both ways; you just have to uncomment the desired behavior.  Thoughts?

Also--the miscmacros module uses a few bindings from the chicken module:

(import (only chicken
  when unless handle-exceptions
  let-optionals make-parameter))

However adding this import line to miscmacros is basically useless (as far as I
can tell) because the macros are expanded in the caller's environment, so the
caller is the one who needs to do the import from chicken.

I'd like to know the proper way to handle this, if any.  Does the caller
need to explicitly import any dependencies?

Similarly, as while* actually expands into an invocation of if*, it does
not work for the caller to do (import (only miscmacros while*)), as the
if* in the resulting expansion of while* will be undefined.

In fact the following doesn't look hygienic at all:

  #;1 (module foo ()
(import scheme (only miscmacros while*))
(define-syntax if*
  (lambda (f r c) (error 'bad)))
(while* (it ( 0 5)) (display it)))

  Error: during expansion of (if*1305 ...) - bad

Is this a bug or am I just confused?


miscmacros.egg
Description: Binary data
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] my first chicken 4 modules ;)

2008-05-28 Thread Jim Ursetto
On 5/28/08, felix winkelmann [EMAIL PROTECTED] wrote:
 2) Throw something like (display foobar), where foobar is unbound,
   into your module and at runtime it will actually display #unbound
   value without throwing an error.  If a procedure is unbound, it
   similarly complains about 'Error: call of non-procedure: #unbound
   value' but this is easily tracked down using the call history.

 How can I reproduce this? I get a proper error message.

Sorry, complete false alarm.  The offending file had
declared (no-bound-checks).  :P


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


Re: [Chicken-users] miscmacros hygienic

2008-05-28 Thread Kon Lovett


On May 28, 2008, at 8:33 PM, Jim Ursetto wrote:

Thank you Jim for your recent life on the bleeding edge. (And Felix  
for expanding space.) I haven't visited yet so anything I say is  
subject to ignorance.



I ported miscmacros (attached) to the hygienic branch and had a couple
questions.

First, is anyone using miscmacros?  I was wondering about the  
following

proposed change to the anaphoric macros:

Current - Proposed
(if* x y z) - (if* (it x) y z)
(while* test body)  - (while* (it test) body)
(repeat* test body) - (repeat* (it test) body)

I think it's nicer not to break hygiene by introducing a hidden 'it'
identifier--like dotimes does not.  In the port I actually  
implemented them

both ways; you just have to uncomment the desired behavior.  Thoughts?


I use the anaphoric forms but not in anger. Yeah, the above is  
more Scheme-ish but I suggest leaving it. Perhaps:


(if/let (it x) y z)
(while/let (it test) body)
...

or

(let/if (it x) y z)
(let/while (it test) body)
...




Also--the miscmacros module uses a few bindings from the chicken  
module:


(import (only chicken
 when unless handle-exceptions
 let-optionals make-parameter))

However adding this import line to miscmacros is basically useless  
(as far as I
can tell) because the macros are expanded in the caller's  
environment, so the

caller is the one who needs to do the import from chicken.

I'd like to know the proper way to handle this, if any.  Does the  
caller

need to explicitly import any dependencies?


I hope not. Ahh, the return of the transitive monster.

That will be unworkable for the user.



Similarly, as while* actually expands into an invocation of if*, it  
does
not work for the caller to do (import (only miscmacros while*)), as  
the

if* in the resulting expansion of while* will be undefined.



So dependencies are not automatically imported? Hum, hoisted by ...  
comes to mind.



In fact the following doesn't look hygienic at all:

 #;1 (module foo ()
   (import scheme (only miscmacros while*))
   (define-syntax if*
 (lambda (f r c) (error 'bad)))
   (while* (it ( 0 5)) (display it)))

 Error: during expansion of (if*1305 ...) - bad

Is this a bug or am I just confused?


Should a user module (program?) local definition, syntax or not,  
override the dependent definitions in an imported form? Good question.


snip

Best Wishes,
Kon




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


Re: [Chicken-users] miscmacros hygienic

2008-05-28 Thread Jim Ursetto
On 5/28/08, Kon Lovett [EMAIL PROTECTED] wrote:
 I use the anaphoric forms but not in anger. Yeah, the above is
 more Scheme-ish but I suggest leaving it.

OK, I changed it back in my copy.  The totally hygienic versions are
still in there, just commented out.

Anyway, hygienic if* is basically cond = and
hygienic repeat* is just dotimes in the opposite direction.
So no need to clutter things up.


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


Re: [Chicken-users] miscmacros hygienic

2008-05-28 Thread Kon Lovett


On May 28, 2008, at 9:18 PM, Jim Ursetto wrote:


On 5/28/08, Kon Lovett [EMAIL PROTECTED] wrote:

I use the anaphoric forms but not in anger. Yeah, the above is
more Scheme-ish but I suggest leaving it.


OK, I changed it back in my copy.  The totally hygienic versions are
still in there, just commented out.

Anyway, hygienic if* is basically cond = and
hygienic repeat* is just dotimes in the opposite direction.
So no need to clutter things up.


I wonder if forms similar to 'and-let' would be useful?

(let-while ([v1 f1] ... [vn fn]) BODY(v1 ... vn))

(let-while ([it (todo foo)]) (bar-ing it))

Best Wishes,
Kon




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