chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Optimal C


From: Rick R
Subject: Re: [Chicken-users] Optimal C
Date: Sun, 22 Feb 2009 18:20:07 -0500

Ahh, I was going overboard by including the crunch macro while using
chicken-crunch.
When I use one technique or the other, the .cpp's are created fine,
however it results in this error from gcc:

/usr/local/include/crunch.h:420: error: explicit template
specialization cannot have a storage class
/usr/local/include/crunch.h:421: error: explicit template
specialization cannot have a storage class
/usr/local/include/crunch.h:788: error: explicit template
specialization cannot have a storage class

In all three cases, the function signature is template<> .
I'm not sure if this is intended.

$ c++ -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.3.2-1ubuntu12'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-targets=all --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)



On Sun, Feb 22, 2009 at 5:56 PM, felix winkelmann <address@hidden> wrote:
> On Sun, Feb 22, 2009 at 11:44 PM, felix winkelmann <address@hidden> wrote:
>>>
>>> 1. crunch.h wasn't created/copied it my std include. I had to
>>> chicken-setup -keep and go to the directory.
>>> The file is named "include". I'm guessing that the script expected
>>> there to be a local directory named include but it didn't exist, so
>>> `mv crunch.h include` failed in such a manner.
>
> Indeed. This should be caught. Thanks for pointing this out.
>
>>>
>>> 2. I tried compiling the example at the bottom of the page at
>>> http://chicken.wiki.br/crunch and it failed with:
>>> Error: name used in bad context
>>> "Definition"
>>> (#(define 0 6) string-reverse (#(lambda 1 5) (str) (#(let-syntax 2 7)
>>> () (let* ((n (string-length str)) (s2 (make-string n #\space))) (do
>>> ((i 0 (add1 i))) ((>= i n)) (string-set! s2 (sub1 (- n i)) (string-ref
>>> str i))) s2))))
>>>
>>
>
> Have you used the chicken-crunch program? The example is meant
> to be directly included into Scheme code, so you should compile
> the example with:
>
> csc -c++ example.scm
>
> To use it with "chicken-crunch", remove the "crunch" macro around the
> definition (and the "use" form as well).
>
>
> cheers,
> felix
>



-- 
We can't solve problems by using the same kind of thinking we used
when we created them.
    - A. Einstein




reply via email to

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