[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] extension of __declare(substitute, "..; ...") syntax

From: Daniel B. Faken
Subject: Re: [Chicken-users] extension of __declare(substitute, "..; ...") syntax?
Date: Thu, 29 Jan 2004 17:05:47 -0500 (EST)

On Thu, 29 Jan 2004, felix wrote:
> Daniel B. Faken wrote:
> > Hello,
> > 
> >   I'm looking to convert some imported C functions' names to lower-case.  
> > For example, glLoadMatrix -> gl-load-matrix.
> >   I haven't been able to find a way to do this with the 'substitute' 
> > syntax, because (AFAIK) it only allows back-references, so I can't switch 
> > the case short of doing something like
> > __declare(substitute, "([a-z])A;\1a")
> > __declare(substitute, "([a-z])B;\1b")
> > __declare(substitute, "([a-z])C;\1c")
> >  ....
> > 
> >   I tracked this back to the implementation of string-substitute (in 
> > pcre.scm), and I didn't see any simple way to do this.
> > 
> >   Thoughts?  Should I implement a more general method?
> > 
> If you just want all converted to lowercase, then compile
> with the `-case-insensitive' option. This will automatically
> treat all FFI-introduced names as lowercase.
> (this feature is pretty new, you might have to use the
> current CVS version)

Sorry; I should have pointed out that I didn't want case-insensitivity.
For example, I'm leaving the GL constants all caps (and want to do this
to help people distinguish btw functions and constants).
E.g. (gl-matrix-mode gl-PROJECTION)

  Also, I just thought people might be interested in more general 
transformations via the "easy FFI".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]