Re: [Chicken-users] to "uses" or not to "uses"

2013-03-24 Thread Moritz Heidkamp
Jörg F. Wittenberger  writes:
> Now I wanted to kick out need to keep duplicates of
> the requirements; once in the uses cluse and below in
> the import list.

Can give an example of what you refer to as "import list"?

Moritz

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


Re: [Chicken-users] to "uses" or not to "uses"

2013-03-24 Thread Peter Bex
On Sun, Mar 24, 2013 at 11:05:49PM +0100, Jörg F. Wittenberger wrote:
> For some reason, several - though not all - procedures
> turn out to be undefined (e.g. resolve to an unbound value
> and then segfault accordingly).
> 

Segfaults should only happen if aggressive optimizations are
enabled.

> To me this looks (at the moment) as if the uses clause enforce
> the correct initialization order, while the imports just declare
> what's seen by the compiler.

Sounds like you may have some phasing issues; definitions in a
module aren't seen by macros defined in the same module, unless
you define-for-syntax them.  Converting old-style Scheme into
modules is kind of tricky, since with older code you could be a
lot sloppier about which definitions are available when.  Now you
have to be precise about at which level a definition exists.

However, without some concrete examples, we can only guess why
stuff isn't working for you.

Cheers,
Peter
-- 
http://www.more-magic.net

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


[Chicken-users] to "uses" or not to "uses"

2013-03-24 Thread Jörg F . Wittenberger

After maintaining a codebase for a couple of years,
I ended up having all my code converted into modules
(while in the beginning there where no modules, just
units).

During the transition I learned that I still need to
maintain the (uses ...) clauses as they where before.

Now I wanted to kick out need to keep duplicates of
the requirements; once in the uses cluse and below in
the import list.

But this does not work out.

For some reason, several - though not all - procedures
turn out to be undefined (e.g. resolve to an unbound value
and then segfault accordingly).

To me this looks (at the moment) as if the uses clause enforce
the correct initialization order, while the imports just declare
what's seen by the compiler.


Is there any better way than to maintain the duplicated import-style
declaration of dependencies?


Thanks a lot

/Jörg





.








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


[Chicken-users] Understanding -block optimization

2013-03-24 Thread Jörg F . Wittenberger

Trying to use -block optimization fails for me badly.

I have a module, which is very simple - Scheme wise.
It's an interface to offload C-call to pthreads (code here:
http://lists.nongnu.org/archive/html/chicken-users/2010-01/msg00046.html
).

For it's simplicity I picked that one to try the -block optimization.

However the resulting binary fails in a strange way. During the startup
the pthreads module is properly initializsed:

[debug] entering toplevel pool_toplevel...
pthreads.scm:339: g2074
pthreads.scm:341: atomic#set-open-fd!
pthreads.scm:344: thread-wait-for-i/o!

however after all inits are done, I see this:

Error: (semaphore-mutex) bad argument type - not a structure of the 
required type # 


Call history:

	pthreads.scm:294: g2051	  
	pthreads.scm:338: make-thread	  
	pthreads.scm:337: thread-start!	  



Strange enough, the pthreads module does not at all use the internal
structure of the semaphore at all.
And the same itself is just a normal define-record-type thing.


If I remove the -block switch and recompile pthread.scm all is fine.
Add it back and it breaks again.


So what exactly does -block handle different that -O3 ?


Thanks for any hint!

/Jörg










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