Re: [Chicken-users] is foreign-parse enum possible ?

2007-03-12 Thread felix winkelmann

On 3/12/07, minh thu <[EMAIL PROTECTED]> wrote:

Hi list,

Is it possible to FOREIGN-PARSE a C enum ?
And a C struct ?

Otherwise, it's really a nice tool.



It should be able to handle C++ ernum and struct definitions,
but not all cases (actually just a few). Look at the grammar
at http://chicken.wiki.br/easyffi


cheers,
felix


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


Re: [Chicken-users] easyffi virtual=0 methods

2007-03-12 Thread felix winkelmann

On 3/12/07, Carlos Pita <[EMAIL PROTECTED]> wrote:


fmscm.scm
--


Ah, yes. I can reproduce it. Thanks, I'll fix this.


cheers,
felix


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


Re: [Chicken-users] bizarre srfi-19 behaviour (maybe DST?)

2007-03-12 Thread Kon Lovett

On Mar 12, 2007, at 11:51 AM, Graham Fawcett wrote:


Hi folks,

I'm puzzled by this behaviour, which I'm only seeing on one of two
Linux machines:

(use srfi-1 srfi-19)
(delete-duplicates
(fold (lambda (n acc) (cons (date-minute (current-date)) acc))
  '() (iota 2000)))

On one machine I get a list of one element, the current minute, eg:  
=> (32)

But on the other machine I'm getting this: => (40 39 38 37 36 35)
Of course, the code is running in subsecond time, so I should see no
more than two values for (date-minute ..) in a given list, and most
likely only one.

The system clock is ok:

(delete-duplicates (map (lambda (n) (current-seconds)) (iota 2000)))
=> (1173724927.0)

The good machine is
 Version 2, Build 41 - linux-unix-gnu-x86 - [ dload ptables  
applyhook ]

The bad one is
 Version 2.5 - linux-unix-gnu-x86 - [ dload ptables applyhook ]

I'm in Canada, and we just moved to daylight-savings time; I can't
tell whether this is a post-DST bug or something else. Thoughts?


Well, your machine is not at fault. At least there was a real bug in  
'(current-date)'. It was performing dst arithmetic when no tz-locale  
was supplied. So, yes, caused by the switch to daylight saving time.  
Thank you for reporting it.


Please get the current srfi-19 egg, version 2.6.1.

Best Wishes,
Kon



Thanks,
Graham


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




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


[Chicken-users] bizarre srfi-19 behaviour (maybe DST?)

2007-03-12 Thread Graham Fawcett

Hi folks,

I'm puzzled by this behaviour, which I'm only seeing on one of two
Linux machines:

(use srfi-1 srfi-19)
(delete-duplicates
(fold (lambda (n acc) (cons (date-minute (current-date)) acc))
  '() (iota 2000)))

On one machine I get a list of one element, the current minute, eg: => (32)
But on the other machine I'm getting this: => (40 39 38 37 36 35)
Of course, the code is running in subsecond time, so I should see no
more than two values for (date-minute ..) in a given list, and most
likely only one.

The system clock is ok:

(delete-duplicates (map (lambda (n) (current-seconds)) (iota 2000)))
=> (1173724927.0)

The good machine is
 Version 2, Build 41 - linux-unix-gnu-x86 - [ dload ptables applyhook ]
The bad one is
 Version 2.5 - linux-unix-gnu-x86 - [ dload ptables applyhook ]

I'm in Canada, and we just moved to daylight-savings time; I can't
tell whether this is a post-DST bug or something else. Thoughts?

Thanks,
Graham


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


Re: [Chicken-users] easyffi virtual=0 methods

2007-03-12 Thread Carlos Pita

> This works for me:
> 
> #>?
> class ScmStkFrames {
>  ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
> interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}
> };
> <#
> 

fmscm.scm
--

(use tinyclos)

#>?

class ScmStkFrames : public StkFrames
{
public:
  ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}
};

<#

Then compile with:

csc -c -c++ -X easyffi fmscm.scm

The diff between your code snippet and mine that makes the difference is
the "public:" visibility modifier being there or not.

Cheers,
Carlos

On Mon, 2007-03-12 at 09:48 +0100, felix winkelmann wrote:
> On 3/12/07, Carlos Pita <[EMAIL PROTECTED]> wrote:
> > I was thinking a bit more about this and concluded that it wouldn't be
> > possible to derive from an abstract C++ class in tinyclos anyway
> > (because of the impossibility of constructing an instance of that class
> > from anywhere but a subclass C++ constructor). So I decided to subclass
> > the problematic class from C++ providing default dummy implementations
> > for the abstract methods. Now I must call the (non-default) constructor
> > of the subclass and I'm having trouble with the easyffi parser for the
> > syntax: ctor(...) : base-ctor(..) {}. One thing I can do to solve this
> > is to put the definition inside a #> <# block and the declaration inside
> > a #>? <# block (instead of putting the definition once in-between #>!
> > <#). But in any case, the easyffi documentation in
> > http://galinha.ucpel.tche.br:8080//easyffi#foreign-include-path states
> > that the grammar supports calling base constructors:
> >
> > CONSTRUCTOR = ["___callback" | "___safe"] ["explicit"] ID "(" ARGTYPE
> > "," ... ")" [BASECONSTRUCTORS] [CODE]
> >
> > Specifically, the problematic line is:
> >
> >   ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
> > interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}
> >
> > And the reported error is:
> >
> > Error: during expansion of (foreign-parse ...) - unexpected tokens: ((op
> > ":") (id "StkFrames") open-paren (id "nFrames") comma (id "nChannels")
> > comma (id "interleaved") close-paren (scope))
> >


> 
> Can you provide a complete example?
> 
> 
> cheers,
> felix






__ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 




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


[Chicken-users] is foreign-parse enum possible ?

2007-03-12 Thread minh thu

Hi list,

Is it possible to FOREIGN-PARSE a C enum ?
And a C struct ?

Otherwise, it's really a nice tool.

Thanks,
thu


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


Re: [Chicken-users] easyffi virtual=0 methods

2007-03-12 Thread felix winkelmann

On 3/12/07, Carlos Pita <[EMAIL PROTECTED]> wrote:

I was thinking a bit more about this and concluded that it wouldn't be
possible to derive from an abstract C++ class in tinyclos anyway
(because of the impossibility of constructing an instance of that class
from anywhere but a subclass C++ constructor). So I decided to subclass
the problematic class from C++ providing default dummy implementations
for the abstract methods. Now I must call the (non-default) constructor
of the subclass and I'm having trouble with the easyffi parser for the
syntax: ctor(...) : base-ctor(..) {}. One thing I can do to solve this
is to put the definition inside a #> <# block and the declaration inside
a #>? <# block (instead of putting the definition once in-between #>!
<#). But in any case, the easyffi documentation in
http://galinha.ucpel.tche.br:8080//easyffi#foreign-include-path states
that the grammar supports calling base constructors:

CONSTRUCTOR = ["___callback" | "___safe"] ["explicit"] ID "(" ARGTYPE
"," ... ")" [BASECONSTRUCTORS] [CODE]

Specifically, the problematic line is:

  ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}

And the reported error is:

Error: during expansion of (foreign-parse ...) - unexpected tokens: ((op
":") (id "StkFrames") open-paren (id "nFrames") comma (id "nChannels")
comma (id "interleaved") close-paren (scope))



This works for me:

#>?
class ScmStkFrames {
ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}
};
<#


Can you provide a complete example?


cheers,
felix


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


Re: [Chicken-users] mayo.egg: the first alpha release of a Scheme source-level debugger for Chicken

2007-03-12 Thread felix winkelmann

On 3/10/07, Tony Sidaway <[EMAIL PROTECTED]> wrote:

This is now available for use.

it's basically a proof of concept, showing how gdb.egg (which is
intentionally built for versatility rather than usability) can be used
to construct a mapping from Scheme to C which enables an end user to
debug a Chicken scheme program.

This egg is capable of identifying Scheme source lines known to the
debugger at the level of the C program, and enables the user to set
breakpoints in the corresponding loaded binary image file and then
running the program until execution is interrupted by a breakpoint or
termination of execution.

https://galinha.ucpel.tche.br/svn/chicken-eggs/mayo/

Login: anonymous
Leave the password blank

In due course an installable egg will probably show up here:



Uploaded.


cheers,
felix


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