osdir.com
mailing list archive

Subject: Re: csi crashes if chicken_home is undefined - msg#00155

List: lisp.scheme.chicken

Date: Prev Next Index Thread: Prev Next Index
On Mon, 20 Dec 2004 08:07:06 +0100, felix winkelmann <bunny351@xxxxxxxxx> wrote:
> On Mon, 20 Dec 2004 08:42:03 +0200, Shmulik Regev <shmul@xxxxxxxxx> wrote:
> > A minor issue that I came across with chicken-1.85 on windows (compiled
> > with VC) is an immediate crash in csi.exe (I believe that in any chicken
> > executable) when chicken_home is undefined. Indeed the readme file clearly
> > states that this should be done, but wouldn't it be convenient to use the
> > current directory if the env variable is undefined?
> >
>
> Absolutely. Thanks for pointing this out.
>

Here's a patch that should work:

cd /home/fwinkel/stuff/chicken/
diff -c /home/fwinkel/stuff/chicken/csi.scm\~
/home/fwinkel/stuff/chicken/csi.scm
*** /home/fwinkel/stuff/chicken/csi.scm~ 2004-12-19 11:28:14.000000000
+0100
--- /home/fwinkel/stuff/chicken/csi.scm 2004-12-20 08:08:09.792128848 +0100
***************
*** 875,881 ****
[strict-srfi0 (member "-strict-srfi-0" args)]
[strict-letrec (or strict strict-srfi0 (member "-strict-letrec"
args))]
[hygienic (or r5rs (member "-hygienic" args) (member "-syntax"
args))]
! [home (chop-separator (chicken-home))]
[ipath (map chop-separator (string-split (or (getenv
"CHICKEN_INCLUDE_PATH") "") ";"))] )

(define (collect-options opt)
--- 875,881 ----
[strict-srfi0 (member "-strict-srfi-0" args)]
[strict-letrec (or strict strict-srfi0 (member "-strict-letrec"
args))]
[hygienic (or r5rs (member "-hygienic" args) (member "-syntax"
args))]
! [home (chop-separator (or (chicken-home) ""))]
[ipath (map chop-separator (string-split (or (getenv
"CHICKEN_INCLUDE_PATH") "") ";"))] )

(define (collect-options opt)

Diff finished at Mon Dec 20 08:08:18


cheers,
felix


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: Passing C pointers into C++ code

On Sun, 19 Dec 2004 19:41:34 +0000, John Lenz <lenz@xxxxxxxxxxx> wrote: > > Yeah, the guile module is able to extract the SWIG pointer from the wrapped > proxy class, but I am not sure how to do it for chicken. Basicly, in the > function that accepts a SWIG pointer, we need to do something like (this is > what the guile module does) > > if (arg is tinyclos class) { > arg = (slot-ref arg 'swig-this) > } > > if (arg is SWIG pointer) { > ... whatever > } > > The problem is, is there any way to access (slot-ref arg 'swig-this) from C > code? The only way I could think of to do it is to use a callback. That > is, inside the SWIG generated scheme file do something like > You can circumvent the mop and extract the slot-values directly: #;1> (use tinyclos) ; loading library tinyclos ... #;2> (define-class <foo> () (a b)) #;3> ,d (make <foo>) instance of class foo: a -> #<unspecified> b -> #<unspecified> #;3> (use lolevel) ; loading library lolevel ... #;4> (record->vector (make <foo>)) #(instance #<class foo> #f #<unspecified> #<unspecified>) #;5> (define s (make <foo>)) #;6> (slot-set! s 'b 99) #;7> (record->vector s) #(instance #<class foo> #f #<unspecified> 99) #;8> (block-ref s 1) #<class foo> ; class of instance s #;9> (block-ref s 2) #f ; method cache #;10> (block-ref s 3) ; slot #1 (a) #;11> (block-ref s 4) ; slot #2 (b) 99 So in this case slot #4 contains the value of the 'b slot. Note that this will naturally not work when the user starts playing with the mop. But for SWIG generated classes this probably doesn't apply anyway. cheers, felix

Next Message by Date: click to view message preview

Re: csi crashes if chicken_home is undefined

On Mon, 20 Dec 2004 08:42:03 +0200, Shmulik Regev <shmul@xxxxxxxxx> wrote: > A minor issue that I came across with chicken-1.85 on windows (compiled > with VC) is an immediate crash in csi.exe (I believe that in any chicken > executable) when chicken_home is undefined. Indeed the readme file clearly > states that this should be done, but wouldn't it be convenient to use the > current directory if the env variable is undefined? > Absolutely. Thanks for pointing this out. cheers, felix

Previous Message by Thread: click to view message preview

Re: csi crashes if chicken_home is undefined

On Mon, 20 Dec 2004 08:42:03 +0200, Shmulik Regev <shmul@xxxxxxxxx> wrote: > A minor issue that I came across with chicken-1.85 on windows (compiled > with VC) is an immediate crash in csi.exe (I believe that in any chicken > executable) when chicken_home is undefined. Indeed the readme file clearly > states that this should be done, but wouldn't it be convenient to use the > current directory if the env variable is undefined? > Absolutely. Thanks for pointing this out. cheers, felix

Next Message by Thread: click to view message preview

Inheriting from C++ in Chicken

Folks, I successfully wrapped the guichan (http://guichan.darkbits.org) library in Chicken using SWIG wrappers. I also wrapped the SDL while I was at it. Guichan has a base Widget class. I'd prefer to extend this class in Scheme rather than in C++. What's the easiest way to achieve this? It seems to me that the simplest way to accomplish this is by generating custom C++ code , i.e. making a pass on the TinyCLOS code to generate the wrapper C++ class. Am I right here? Are there any examples of Scheme code parsing Scheme code? Is the Chicken compiler code easy to adopt here or should I just do this in a totally different manner? Thanks, Joel -- OpenPoker: The Linux of poker software http://wagerlabs.com/forums Tenerife: Canary Islands: Spain
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by