Search found 78 matches

by Harnon
Thu Jun 18, 2009 6:11 pm
Forum: Common Lisp
Topic: Arg!!! - C Interfacing Problem
Replies: 2
Views: 4142

Arg!!! - C Interfacing Problem

I haven't had much experience with c, but I've had to dwell into it in order to figure out what i am doing wrong with my c binding. I finally distilled it to this code - Test C code (test.c) typedef float testing[2]; void tester (testing* in, float a1, float a2, float a3, float a4) { in[0][0] = a1; ...
by Harnon
Tue Jun 16, 2009 7:27 pm
Forum: Common Lisp
Topic: Coercing to double-float
Replies: 4
Views: 5888

Re: Coercing to double-float

Sorry. (coerce .2 'double-float) produces
0.20000000298023224d0

(* .2 1d0) produces 0.20000000298023224d0

(* .2d0 .1d0) produces
0.020000000000000004d0

I think I will just stick to the float version of the c library. Thanks for the explanation!
by Harnon
Tue Jun 16, 2009 1:37 pm
Forum: Common Lisp
Topic: Coercing to double-float
Replies: 4
Views: 5888

Coercing to double-float

Quite simply, i need to use the type double for a foreign function argument. When I do the following:
(coerce .2 'double-float)
it returns on Allegro 8.1 running under windows vista 32 bit
0.22200000286102295d0
Why is the new number different??? What's going on :roll:
by Harnon
Fri Jun 05, 2009 5:11 am
Forum: Common Lisp
Topic: Slew of DLL Dependencies
Replies: 2
Views: 5873

Slew of DLL Dependencies

I've put up with this annoyance for quite a while, but now I thought 'hey, why not ask the lisp forum?' So here I am :mrgreen: I would also like to know if anyone has encountered this problem before. Basically, the problem is that in order to load one dll, I need to load the required other dlls in t...
by Harnon
Mon Feb 02, 2009 7:06 pm
Forum: Common Lisp
Topic: Allegro 8.0 Infinite Loop Stalling
Replies: 4
Views: 7133

Re: Allegro 8.0 Infinite Loop Stalling

Thank you a million times!!!! :D :D :D :D You're absolutetly right. All i had to do was add (portable-threads:thread-yield) and everything worked!! Oh, and just in case anyone starts using threads, you do in fact have to use #. because otherwise the thread will default to its own *standard-output*, ...
by Harnon
Sun Feb 01, 2009 7:06 am
Forum: Common Lisp
Topic: Allegro 8.0 Infinite Loop Stalling
Replies: 4
Views: 7133

Allegro 8.0 Infinite Loop Stalling

I'm trying to create a mouse polling loop in a thread. For an easy example of my problem, consider this code: (portable-threads::spawn-thread "MOUSE" (lambda () (loop ; (print "HI" #.*standard-output*) (handler-case (poll-mouse nil (:button (print "button press" #.*stan...
by Harnon
Sat Dec 27, 2008 10:39 pm
Forum: Common Lisp
Topic: Timers
Replies: 7
Views: 13473

Re: Timers

Wow! Ecl looks like exactly what i need, if i can manage to compile it (scratches head).
by Harnon
Sat Dec 27, 2008 11:22 am
Forum: Common Lisp
Topic: Timers
Replies: 7
Views: 13473

Re: Timers

Thx! I looked at the trivial-timeout, but it only supports those implementations with support for threads and/or timer scheduling. :cry: I also did a simple test with the gui callbacks, and it appears i was right. The whole program is event driven, there is no other lisp code running unless an event...
by Harnon
Sat Dec 27, 2008 9:44 am
Forum: Common Lisp
Topic: Timers
Replies: 7
Views: 13473

Re: Timers

Thx for the quick reply :D
I was thinking about using lispworks for this, but i hate to create something that isn't portable across lisp implementations, though i suppose it really wouldn't matter in the end.
Does anyone else have ideals about using callbacks from c to implement timers?
Thx again :)
by Harnon
Sat Dec 27, 2008 7:41 am
Forum: Common Lisp
Topic: Timers
Replies: 7
Views: 13473

Timers

K, so i would like a timer which interrupts the lisp code and runs a specified code every x seconds. I've tried win32 standard timers, they don't work because they schedule based on how busy the program (cpu) is, and multimedia timers just crash lispworks (haven't tried any other platforms). So, i s...