Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Some questions, maybe naive ones
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stefan Behnel  
View profile  
 More options Sep 28 2012, 3:43 pm
From: Stefan Behnel <stefan...@behnel.de>
Date: Fri, 28 Sep 2012 21:43:30 +0200
Local: Fri, Sep 28 2012 3:43 pm
Subject: Re: [cython-users] Some questions, maybe naive ones
Chris Barker, 28.09.2012 21:36:

> On Fri, Sep 28, 2012 at 10:32 AM, JBT wrote:
>> So, here is another question. Cython won't compile these two statements:
>>     cdef static char        CDFname[] = {"test1"}
>>     cdef static long dimSizes[2] = {100,200}
>> because cython sees them with syntax error. I found the corresponding c code
>> (without the *cdef*) in the NASA CDF C reference manual, so I presume the C
>> counterpart is correct. So, why does cython think the two statements are not
>> correct?

> becaseu that is how you initialize arrays in C, not Python (or Cython)
> -- remember that Cyton is closer to Python is syntax than C. For
> instance, the {} are used to defien a dcitionaly literal.

> try:

>  cdef static char        CDFname = "test1"
>  cdef static long dimSizes[2] = [100, 200]

> (though you may need a char* there -- a char is one charactor.

> (unteseted, and I'm no expert, but this is closer, for sure.)

Cython has no keyword "static" because all globally declared C names are
static anyway.

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.