dan j | 19 May 2013 15:31
Picon

bb - fix needed

Egg named "bb" (GUI toolkit) uses "getenv" in setup script, but documentation says: "getenv was removed in Chicken 4.6.4. Use get-environment-variable instead.". I founded this when i tried to install bb. Log:

B:\home\>chicken-install bb
retrieving ...
connecting to host "chicken.kitten-technologies.co.uk", port 80 ...
requesting "/henrietta.cgi?name=bb&mode=default" ...
reading response ...
HTTP/1.1 200 OK
Date: Sun, 19 May 2013 13:28:03 GMT
Server: Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.9-dev DAV/2 SVN/1.7.8 PHP/5.4.13 mod_fastcgi
/2.4.6
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain
reading chunks ......
reading files ...
  ./Table.cxx
  ./Table.h
  ./bb-support.cpp
  ./bb.h
  ./bb.meta
  ./bb.scm
  ./bb.setup
 bb located at C:\Users\Doc\AppData\Local\Temp/tempfb1a.2752/bb
checking platform for `bb' ...
checking dependencies for `bb' ...
install order:
("bb")
installing bb:1.31 ...
changing current directory to C:\Users\Doc\AppData\Local\Temp/tempfb1a.2752/bb
  "B:\bin\csi" -bnq -setup-mode -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-
error-handling)" -e "(extension-name-and-version '(\"bb\" \"1.31\"))" "C:\Users\Doc\AppData\Local\Te
mp\tempfb1a.2752\bb\bb.setup"

Error: unbound variable: getenv


Error: shell command terminated with nonzero exit code
70
"\"B:\\bin\\csi\" -bnq -setup-mode -e \"(require-library setup-api)\" -e \"(impo...

OS: Windows, chicken compiled by MinGW


I hope it helps. Sorry for bad english.
_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Răzvan Rotaru | 13 May 2013 22:09
Picon

reader macros

Hi,

I have not found information about this topic, so I have to ask here: does chicken provide reader macros?

Răzvan
_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Jörg F. Wittenberger | 12 May 2013 14:41

need help with hygienic macros

Hi all,

not exactly chicken related; but I hope someone here can help me.

I'm trying to replace an unhygienic macro with a syntax-rules
based version.  Just I can't.

What I need is a sub-macro.
 http://community.schemewiki.org/?scheme-faq-macros#H-1tseqi3

I want to have a define-alike to create procedures with
a certain signature.  Within the body of the created procedure
I need some syntax to access the parameters of the created
procedure.  The purpose however is to *not* repeat the
parameter list in the definitions (since that's what might
change, hence the definer macro to hide the precise signature).

Here my current state of affairs:

;; The definer:

(define-syntax deftig
  (syntax-rules ()
    ((_ name . body)  ;; Within this "body" I want some rewrites.
     (define name
       (lambda (x y)
	 (let-syntax
	     ((pinapple
	       (syntax-rules ()
		 ((_ ((p v) ...) . body)
		  (let-syntax ((helper (syntax-rules ()
					 ((_ p ...) (begin . body))))) 
		    (helper v ...))))))

           ;; trying to bind "foo" and "gosh" within "body" here

	   (pinapple ((foo (x y)) (gosh y)) . body)))))

;; This alternate version did not grok it either:

    ((_ "pinapple" ((p v) ...) . body)
     (let-syntax ((helper (syntax-rules ()
			    ((_ p ...) (begin . body))))) 
       (helper v ...)))
    #;((_ name body ...)
     (define name
       (lambda (x y)
	 (deftig "pinapple" ((foo (x y)) (gosh y)) body ...))))
    ))

;; An example of intended usage:

(define (foog x) (* x 2))

;; "foo" and "gosh" ought to be replaced, but aren't.

(deftig bar (foo) (foog 2) (foog 2.5) (let ((n (gosh))) (foog n)) 'phar)

----

The pinapple is actually stolen from let-alias
http://community.schemewiki.org/?scheme-faq-macros#H-uren6
which was the closes thing I could find so far.

But it seems only to get close to the job when used in the
let-syntax way as above.  At least I've been able to
get partial results.  But no flowers.

Any help very much appreciated.

/Jörg

.......
pluijzer . | 12 May 2013 02:14
Picon
Gravatar

Passing floats to and from foreign functions

Hello everybody,
I'm having trouble passing floating point numbers to and from foreign functions.

This is what I'm doing:

-- test.scm --

(require-extension easyffi)
(print ((foreign-lambda float "testGet")))
((foreign-lambda void "testSet" float) 4.0)
(print ((foreign-lambda float "testGet")))

-- wrapper.c --

float a = 5.0;
void testSet(float value) { a = value; }
float testGet(void) { return a; }

What I get is this:

> csc -X easyffi wrapper.c test.scm
> ./test
-1080529876.0
-1080533140.0

But I expected the output to be:
4.0
5.0

I'm I doing something wrong/forgetting something?
When I use integers instead of floats I do get the desired result.

Thank you in advance,
Righard

_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Mathieu Desrochers | 11 May 2013 23:03
Picon
Favicon

Thanks Chicken Scheme

Many thanks for making it possible to write software in scheme.

I just spent a few months hacking a web application handled by the Chicken Scheme runtime.
Just posting a link to the project page in the hope of giving something back.


In the unlikely event you find anything useful there, please feel free to use it :)

Mathieu
_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Kooda | 11 May 2013 17:48

A couple of questions

Hi,

I’ve been working with Scheme for quite some time now, with various
implementations, and I wanted to thank you for working on this wonderful
one that is Chicken.

I’m still pretty new to functional programming and I recently discovered
the functional reactive programming style. I was wondering if anyone
here had any experience with it in Scheme. I would like to implement a
DSL on top of OpenGL for FRP graphic programming.  If you have any
documentation or existing implementation please tell me.

I also wanted to know if it was possible to statically link a chicken
program with all its libraries in order to have a standalone executable
not depending on anything.

Thanks again,
Kooda.

--

-- 
Envoyé depuis ma Game Boy.

_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Felix | 10 May 2013 14:38

Re: z3lib testing

Hello!

Many thanks for the test-reports for the recent changes to the z3 egg. 

Much appreciated!

cheers,
felix
Alan Post | 9 May 2013 03:04
Favicon
Gravatar

link error with PROGRAM_PREFIX and compiling eggs

I have built chicken using the PROGRAM_PREFIX option:

  $ gmake PROGRAM_PREFIX=foo- ...

When I try to install an egg, using foo-chicken-install, I get an error
from gcc that it cannot locate -lchicken:

  installing iset:1.8 ...
  changing current directory to /tmp/temp835e.3607/iset
    /home/a/wa/foo/bin/foo-csi -bnq -setup-mode -e "(require-library setup-api)" -e "(import
setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"iset\" \"1.8\"))" /tmp/temp835e.3607/iset/iset.setup
    /home/a/wa/foo/bin/foo-csc -feature compiling-extension -setup-mode    -s -O3 -inline -d1 iset.scm -j iset
  /usr/bin/ld: cannot find -lchicken
  collect2: ld returned 1 exit status

  Error: shell command terminated with non-zero exit status 256: gcc iset.o -o iset.so - shared
-L/usr/X11R6/lib -L/usr/local/lib -L"/home/a/wa/foo/lib" -Wl,-R"/home/a/wa/foo/lib" -lchicken
-lm -lpthread

This would be expected, as it should be trying to find -lfoo-chicken.
Looking at the code, it appears there is some confusion between -host
and PROGRAM_PREFIX: 

  $ foo-csc -libs
  -lchicken -lm -lpthread

  $ foo-csc -host -libs
  -lfoo-chicken -lm -lpthread

The chicken-install code is apparently expecting the first command here,
'foo-csc -libs', to return '-lfoo-chicken'.  I'm not sure what the
command-line should be when -host is specified.

Will you help me sort this out?

-Alan
--

-- 
my personal website: http://c0redump.org/
Peter Bex | 8 May 2013 20:18
Picon
Picon
Favicon

[SECURITY] Incomplete fix for CVE-2012-6122 (select() fs_set buffer overrun)

Hello CHICKEN users,

Recently, we fixed a problem related to the use of POSIX select(),
which was assigned CVE-2012-6122.
See http://lists.nongnu.org/archive/html/chicken-users/2012-06/msg00031.html
for more details on the original bug.

We fixed the scheduler, but there remained other places in CHICKEN where
select() was still in use:

- The R5RS char-ready? procedure when invoked on stream ports or custom
   input ports created by the process procedure from unit posix (in *NIX)
- The tcp-accept-ready? procedure from unit tcp
- The file-select procedure from unit posix

These have now also been rewritten in terms of POSIX poll(), where
available.  This is on all supported platforms except Windows.
As before, there is no danger of buffer overrun on Windows, but
there is a situation where threads may never wake up.  There is no
known workaround.  A solution may be provided soon.

Currently all released versions of CHICKEN have this bug.  It has
been fixed in git master, commit 556108092774086b6c86c2e27daf3f740ffec091.
CHICKEN 4.9.0 will also include the bugfix.

The known workaround is still to limit the maximum number of open
descriptors using the Unix "ulimit -n" command, so that it matches the
value of FD_SETSIZE.  This value can be checked by compiling the
following one-line program with csc and running the resulting binary:

(print (foreign-value "FD_SETSIZE" int))

Kind regards,
The CHICKEN Team
Michele La Monaca | 8 May 2013 15:48

Issues with socket egg

Hi,

while using this egg I experienced a few issues:

1)  (inet-address) always fails on Solaris.

I consistently get "Error: (inet-address) invalid internet address".
This seems to be related to the definition of AI_NUMERICSERV.

<netdb.h> has these definitions on Solaris:

#define AI_PASSIVE      0x0008  /* intended for bind() + listen() */
#define AI_NUMERICHOST  0x0020  /* use numeric node address string */
#define AI_NUMERICSERV  0x0040  /* servname is assumed numeric */

Manually setting AI_NUMERICSERV to 0 solves the problem but I am not
sure why the problem occurs with Solaris' defines.

2) The egg doesn’t install on Cygwin due to the unbound identifier
'SO_EXCLUSIVEADDRUSE' (mingw only?). Dropping the related option
(so/exclusiveaddruse) solves the problem.

3) I need an option/function to explicitly set the socket as
non-blocking (i.e. without invoking socket-connect). As a temporary
workaround I exported the function _make_socket_nonblocking. Can this
workaround (or anything equivalent) made be available in the egg?

Thanks in advance.

Ciao,
Michele
Felix | 8 May 2013 11:39

z3 lib update

Hello!

I have updated the "z3" egg to update it to the newest upstream
version.  This should also fix the problem on FreeBSD recently
reported (caused by a missing macro definition on this platform). The
new version should take care of this automatically, regardless of
platform, so if someone could give it a try on one or more of the
usual BSD systems, I'd be very grateful. A simple

  chicken-install -test z3

should be sufficient. The version is 1.44, and the egg should be
available shortly.

thanks.

cheers,
felix

Gmane