Re: [Chicken-users] The point of 'provide'

2010-01-05 Thread John Cowan
Peter Bex scripsit:

> That's interesting, but what I really meant was: "is there a way to add
> directories to where USE looks for extensions?"

USE looks where REQUIRE looks, so try setting the environment variable
CHICKEN_REPOSITORY or the parameter repository-path.

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
Nobody expects the RESTifarian Inquisition!  Our chief weapon is
surprise ... surprise and tedium  ... tedium and surprise 
Our two weapons are tedium and surprise ... and ruthless disregard
for unpleasant facts  Our three weapons are tedium, surprise, and
ruthless disregard ... and an almost fanatical devotion to Roy Fielding


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


Re: [Chicken-users] Embedded C Question

2010-01-05 Thread Thomas Bushnell BSG
The FFI facilities are only available in compiled code.  If you want to
use them in interpreted code, package the FFI bits into a separate file,
compile it with -s, and then you can load that into the interpreter.

Thomas


On Mon, 2010-01-04 at 17:33 -0500, David N Murray wrote:
> Hi all,
> 
> I've been toying around with embedded C just to learn how.  I have the
> following sample:
> 
> (use easyffi)
> (import foreign)
> 
> #>
> #include 
> #include 
> 
> const char* dummy(char* dst, int len, int seconds) {
>   struct tm* tm = localtime(&seconds);
>   snprintf(dst, len, "%02d/%02d:%02d:%02d:%02d:", tm->tm_mon + 1,
>tm->tm_mday, tm->tm_hour,tm->tm_min, tm->tm_sec);
>   return dst;
> }
> <#
> 
> (define c-dummy (foreign-lambda c-string "dummy" c-string
> integer integer))
> 
> (define (test-dummy)
>   (c-dummy (make-string 128) 128 1242403665))
> 
> (print (bar->string))
> 
> It runs fine this way (actually, it also runs without the first two
> lines):
> 
> $ csc t2.scm
> 
> Warning: re-importing already imported syntax: foreign-declare
> 
> Warning: re-importing already imported syntax: foreign-declare
> /usr/local/lib/libchicken.so: warning: strcpy() is almost always misused,
> please use strlcpy()
> /usr/local/lib/libchicken.so: warning: sprintf() is often misused, please
> use snprintf()
> /usr/local/lib/libchicken.so: warning: strcat() is almost always misused,
> please use strlcat()
> $ ./t2
> 05/15:12:07:45:
> $
> 
> However, when I try and run it in csi, I get the following:
> $ csi t2.scm
> 
> CHICKEN
> (c)2008-2009 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.3.0
> openbsd-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
> compiled 2010-01-04 on kili.jsbsystems.com (OpenBSD)
> 
> ; loading ~/.csirc ...
> ; loading /usr/local/lib/chicken/4/readline.import.so ...
> ; loading /usr/local/lib/chicken/4/scheme.import.so ...
> ; loading /usr/local/lib/chicken/4/chicken.import.so ...
> ; loading /usr/local/lib/chicken/4/foreign.import.so ...
> ; loading /usr/local/lib/chicken/4/ports.import.so ...
> ; loading /usr/local/lib/chicken/4/data-structures.import.so ...
> ; loading /usr/local/lib/chicken/4/posix.import.so ...
> ; loading /usr/local/lib/chicken/4/readline.so ...
> ; loading t2.scm ...
> ; loading /usr/local/lib/chicken/4/easyffi.so ...
> ; loading /usr/local/lib/chicken/4/easyffi-base.so ...
> ; loading /usr/local/lib/chicken/4/easyffi.import.so ...
> 
> Warning: declarations are ignored in interpreted code: (##core#declare
> (foreign-declare "\n#define _X_OPEN_SOURCE\n#include \n#include
> \n\nconst char* bar2string(char* dst, int len, int seconds) {\n
> struct tm* tm = localtime(&seconds);\n  snprintf(dst, len,
> \"%02d/%02d:%02d:%02d:%02d:\", tm->tm_mon + 1, \n\t\t   tm->tm_mday,
> tm->tm_hour,tm->tm_min, tm->tm_sec);\n  return dst;\n}\n" "\n"))
> 
> Error: unbound variable: foreign-lambda
> 
> Call history:
> 
> g626627
> action383
> (##core#declare (foreign-declare
> "\n#define _X_OPEN_SOURCE\n#include \n#include \n\...
> (##core#undefined)
> (define c-bar2string (foreign-lambda
> c-string "bar2string" c-string integer integer))
> (##core#set! c-bar2string (foreign-lambda
> c-string "bar2string" c-string integer integer))
> (foreign-lambda c-string "bar2string"
> c-string integer integer)
>   (foreign-lambda c-string "bar2string" c-string
> integer integer) <--
> $
> 
> What am I missing?
> 
> TIA,
> Dave
> 
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users




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


Re: [Chicken-users] The point of 'provide'

2010-01-05 Thread Mario Domenech Goulart
On Tue, 5 Jan 2010 14:59:21 +0100 Peter Bex  wrote:

> On Sun, Jan 03, 2010 at 10:13:05PM -0500, John Cowan wrote:
>> Peter Bex scripsit:
>> 
>> > My goal here is to load a file regardless of whether it was loaded by
>> > some bootstrap code or installed as an extension.
>> > 
>> > Is there a way to do this programmatically?
>> 
>> Require does the job as far as mere loading is concerned, but as for
>> programmatic importing, you must use the undocumented ##sys#import
>> procedure.
>
> That's interesting, but what I really meant was: "is there a way to add
> directories to where USE looks for extensions?"

Maybe #135 (http://www.irp.oist.jp/trac/chicken/ticket/135) is somehow
related to what you want.

Best wishes.
Mario


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


Re: [Chicken-users] Egg request: 4/aes

2010-01-05 Thread Mario Domenech Goulart
Hi Alaric

On Tue, 05 Jan 2010 17:17:50 + Alaric Snell-Pym  
wrote:

> I'm porting my old chicken3 aes egg to chicken4. Well, rather, I'm
> applying c-keen's patches to do same, and fixing a few things here and
> there. Please can I have a 4/aes egg dir in svn? There doesn't seem to
> be one yet!

It's done.  Thank you.

Best wishes.
Mario


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


[Chicken-users] Embedded C Question

2010-01-05 Thread David N Murray
Hi all,

I've been toying around with embedded C just to learn how.  I have the
following sample:

(use easyffi)
(import foreign)

#>
#include 
#include 

const char* dummy(char* dst, int len, int seconds) {
  struct tm* tm = localtime(&seconds);
  snprintf(dst, len, "%02d/%02d:%02d:%02d:%02d:", tm->tm_mon + 1,
   tm->tm_mday, tm->tm_hour,tm->tm_min, tm->tm_sec);
  return dst;
}
<#

(define c-dummy (foreign-lambda c-string "dummy" c-string
integer integer))

(define (test-dummy)
  (c-dummy (make-string 128) 128 1242403665))

(print (bar->string))

It runs fine this way (actually, it also runs without the first two
lines):

$ csc t2.scm

Warning: re-importing already imported syntax: foreign-declare

Warning: re-importing already imported syntax: foreign-declare
/usr/local/lib/libchicken.so: warning: strcpy() is almost always misused,
please use strlcpy()
/usr/local/lib/libchicken.so: warning: sprintf() is often misused, please
use snprintf()
/usr/local/lib/libchicken.so: warning: strcat() is almost always misused,
please use strlcat()
$ ./t2
05/15:12:07:45:
$

However, when I try and run it in csi, I get the following:
$ csi t2.scm

CHICKEN
(c)2008-2009 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.3.0
openbsd-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2010-01-04 on kili.jsbsystems.com (OpenBSD)

; loading ~/.csirc ...
; loading /usr/local/lib/chicken/4/readline.import.so ...
; loading /usr/local/lib/chicken/4/scheme.import.so ...
; loading /usr/local/lib/chicken/4/chicken.import.so ...
; loading /usr/local/lib/chicken/4/foreign.import.so ...
; loading /usr/local/lib/chicken/4/ports.import.so ...
; loading /usr/local/lib/chicken/4/data-structures.import.so ...
; loading /usr/local/lib/chicken/4/posix.import.so ...
; loading /usr/local/lib/chicken/4/readline.so ...
; loading t2.scm ...
; loading /usr/local/lib/chicken/4/easyffi.so ...
; loading /usr/local/lib/chicken/4/easyffi-base.so ...
; loading /usr/local/lib/chicken/4/easyffi.import.so ...

Warning: declarations are ignored in interpreted code: (##core#declare
(foreign-declare "\n#define _X_OPEN_SOURCE\n#include \n#include
\n\nconst char* bar2string(char* dst, int len, int seconds) {\n
struct tm* tm = localtime(&seconds);\n  snprintf(dst, len,
\"%02d/%02d:%02d:%02d:%02d:\", tm->tm_mon + 1, \n\t\t   tm->tm_mday,
tm->tm_hour,tm->tm_min, tm->tm_sec);\n  return dst;\n}\n" "\n"))

Error: unbound variable: foreign-lambda

Call history:

g626627
action383
(##core#declare (foreign-declare
"\n#define _X_OPEN_SOURCE\n#include \n#include \n\...
(##core#undefined)
(define c-bar2string (foreign-lambda
c-string "bar2string" c-string integer integer))
(##core#set! c-bar2string (foreign-lambda
c-string "bar2string" c-string integer integer))
(foreign-lambda c-string "bar2string"
c-string integer integer)
  (foreign-lambda c-string "bar2string" c-string
integer integer) <--
$

What am I missing?

TIA,
Dave



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


Re: [Chicken-users] The point of 'provide'

2010-01-05 Thread Peter Bex
On Sun, Jan 03, 2010 at 10:13:05PM -0500, John Cowan wrote:
> Peter Bex scripsit:
> 
> > My goal here is to load a file regardless of whether it was loaded by
> > some bootstrap code or installed as an extension.
> > 
> > Is there a way to do this programmatically?
> 
> Require does the job as far as mere loading is concerned, but as for
> programmatic importing, you must use the undocumented ##sys#import
> procedure.

That's interesting, but what I really meant was: "is there a way to add
directories to where USE looks for extensions?"

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
-- Donald Knuth


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


Re: [Chicken-users] Embedded C Question

2010-01-05 Thread John Cowan
David N Murray scripsit:

> However, when I try and run it in csi, I get the following:
> $ csi t2.scm

Embedded C does not work in the interpreter, because it doesn't
interpret C.  In the compiler, embedded C is basically passed straight
through for gcc to compile.

-- 
John Cowan   co...@ccil.orghttp://ccil.org/~cowan
[R]eversing the apostolic precept to be all things to all men, I usually [before
Darwin] defended the tenability of the received doctrines, when I had to do
with the [evolution]ists; and stood up for the possibility of [evolution] among
the orthodox --thereby, no doubt, increasing an already current, but quite
undeserved, reputation for needless combativeness.  --T. H. Huxley


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


[Chicken-users] Embedded C Question

2010-01-05 Thread David N Murray
(apologies if this posts twice to the list.  originally sent 20 hours ago)

Hi all,

I've been toying around with embedded C just to learn how.  I have the
following sample:

(use easyffi)
(import foreign)

#>
#include 
#include 

const char* dummy(char* dst, int len, int seconds) {
  struct tm* tm = localtime(&seconds);
  snprintf(dst, len, "%02d/%02d:%02d:%02d:%02d:", tm->tm_mon + 1,
   tm->tm_mday, tm->tm_hour,tm->tm_min, tm->tm_sec);
  return dst;
}
<#

(define c-dummy (foreign-lambda c-string "dummy" c-string
integer integer))

(define (test-dummy)
  (c-dummy (make-string 128) 128 1242403665))

(print (test-dummy))

It runs fine this way (actually, it also runs without the first two
lines):

$ csc t2.scm

Warning: re-importing already imported syntax: foreign-declare

Warning: re-importing already imported syntax: foreign-declare
/usr/local/lib/libchicken.so: warning: strcpy() is almost always misused,
please use strlcpy()
/usr/local/lib/libchicken.so: warning: sprintf() is often misused, please
use snprintf()
/usr/local/lib/libchicken.so: warning: strcat() is almost always misused,
please use strlcat()
$ ./t2
05/15:12:07:45:
$

However, when I try and run it in csi, I get the following:
$ csi t2.scm

CHICKEN
(c)2008-2009 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.3.0
openbsd-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2010-01-04 on kili.jsbsystems.com (OpenBSD)

; loading ~/.csirc ...
; loading /usr/local/lib/chicken/4/readline.import.so ...
; loading /usr/local/lib/chicken/4/scheme.import.so ...
; loading /usr/local/lib/chicken/4/chicken.import.so ...
; loading /usr/local/lib/chicken/4/foreign.import.so ...
; loading /usr/local/lib/chicken/4/ports.import.so ...
; loading /usr/local/lib/chicken/4/data-structures.import.so ...
; loading /usr/local/lib/chicken/4/posix.import.so ...
; loading /usr/local/lib/chicken/4/readline.so ...
; loading t2.scm ...
; loading /usr/local/lib/chicken/4/easyffi.so ...
; loading /usr/local/lib/chicken/4/easyffi-base.so ...
; loading /usr/local/lib/chicken/4/easyffi.import.so ...

Warning: declarations are ignored in interpreted code: (##core#declare
(foreign-declare "\n#define _X_OPEN_SOURCE\n#include \n#include
\n\nconst char* bar2string(char* dst, int len, int seconds) {\n
struct tm* tm = localtime(&seconds);\n  snprintf(dst, len,
\"%02d/%02d:%02d:%02d:%02d:\", tm->tm_mon + 1, \n\t\t   tm->tm_mday,
tm->tm_hour,tm->tm_min, tm->tm_sec);\n  return dst;\n}\n" "\n"))

Error: unbound variable: foreign-lambda

Call history:

g626627
action383
(##core#declare (foreign-declare
"\n#define _X_OPEN_SOURCE\n#include \n#include \n\...
(##core#undefined)
(define c-bar2string (foreign-lambda
c-string "bar2string" c-string integer integer))
(##core#set! c-bar2string (foreign-lambda
c-string "bar2string" c-string integer integer))
(foreign-lambda c-string "bar2string"
c-string integer integer)
  (foreign-lambda c-string "bar2string" c-string
integer integer) <--
$

What am I missing?

TIA,
Dave



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


[Chicken-users] Egg request: 4/aes

2010-01-05 Thread Alaric Snell-Pym


Hello!

I'm porting my old chicken3 aes egg to chicken4. Well, rather, I'm
applying c-keen's patches to do same, and fixing a few things here and
there. Please can I have a 4/aes egg dir in svn? There doesn't seem to
be one yet!

Thanks,

ABS


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


[Chicken-users] Volunteering for Scheme language standardization working groups ***deadline January 8***

2010-01-05 Thread Marc Feeley
*** PLEASE NOTE THAT THE DEADLINE IS JANUARY 8 ***

The Scheme Language Steering Committee solicits volunteers who are willing to 
serve on working groups 1 and/or 2.  Volunteers should: 

* be prepared to serve for the duration named in the group's charter 
charter for working group 1: 
  http://www.scheme-reports.org/2009/working-group-1-charter.html 
charter for working group 2: 
  http://www.scheme-reports.org/2009/working-group-2-charter.html 
* believe in the value of standardization 
* accept the goals and limitations of the working group's charter 
* support the goal of sharing Scheme code effectively 
* be able to work constructively toward compromise 

To volunteer for one or both of the working groups, send email to 

   steering-committee-feedb...@scheme-reports.org 

with the following information: 

   your name 
   your email address 
   the working group(s) for which you are volunteering 
   a  statement explaining who you are and why and how you 
   believe you would contribute to the success of the 
   working group 

Please send your email by 8 January 2010. 

Will Clinger 
Marc Feeley 
Chris Hanson 
Jonathan Rees 
Olin Shivers



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