Re: [Chicken-users] call Chicken Scheme from C and pass a bytevector

2013-06-27 Thread Claude Marinier
Hi, Actually, the bytes should probably be allocated in the structure, right? struct ipv4_addr_struct { C_header tag; uint8_t octets[4]; }; typedef struct ipv4_addr_struct ipv4_addr; static const C_header BTREE_TAG = ((sizeof(ipv4_addr) - sizeof(C_header)) / sizeof(C_wor

Re: [Chicken-users] call Chicken Scheme from C and pass a bytevector

2013-06-27 Thread Claude Marinier
On Thu, 27 Jun 2013, Dan Leslie wrote: There's a section on accessing external objects that covers this sort of thing: http://wiki.call-cc.org/man/4/Accessing%20external%20objects#returning-large-objects-or-chunks-of-memory-to-scheme This addresses a different issue. The PCAP event handler in

Re: [Chicken-users] representation of a procedure

2013-06-27 Thread Kon Lovett
On Jun 27, 2013, at 9:52 AM, "Daniel Ajoy" wrote: > Hi, > > Is there a function that gives the content of a procedure (it's definition)? The interpreter doesn't save the original s-expr & neither does the compiler. Reflection facilities are slim. You can recover, sometimes, the expected argu

Re: [Chicken-users] call Chicken Scheme from C and pass a bytevector

2013-06-27 Thread Dan Leslie
There's a section on accessing external objects that covers this sort of thing: http://wiki.call-cc.org/man/4/Accessing%20external%20objects#returning-large-objects-or-chunks-of-memory-to-scheme It's possible to allocate C structures under the control of the Chicken GC: http://wiki.call-cc.org/a

[Chicken-users] call Chicken Scheme from C and pass a bytevector

2013-06-27 Thread Claude Marinier
Hi, A function in pcap-interface.c calls Chicken Scheme. It builds a vector containing a bunch of things, e.g. C_fix(ethtype), and the source and destination addresses as vectors. The scheme code converts the address vectors to u8vector (u16vector for IPv6). This is a lot of work: just under

[Chicken-users] representation of a procedure

2013-06-27 Thread Daniel Ajoy
Hi, Is there a function that gives the content of a procedure (it's definition)? Daniel ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users

Re: [Chicken-users] dynamic scoping

2013-06-27 Thread Felix
From: John Cowan Subject: Re: [Chicken-users] dynamic scoping Date: Wed, 26 Jun 2013 20:17:38 -0400 > Dan Leslie scripsit: > >> The related SRFI is withdrawn, is it safe to assume that fluid-let >> will be available outside of Chicken? > > The implementation of fluid-let is trivial, provided yo