I see this as a missing feature for one reason: as silly as the syntax might 
be, it is used in the wild.  Until gcc rejects it, it would be nice if NB would 
accept it.  The closer we get toward what should be our ultimate goal (header 
files in, working binding out), the more details like these matter.



________________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[pharo-project-boun...@lists.gforge.inria.fr] on behalf of Fernando Olivero 
[fernando.oliv...@usi.ch]
Sent: Wednesday, December 14, 2011 8:08 PM
To: Pharo-project@lists.gforge.inria.fr
Subject: Re: [Pharo-project] NB Bug?

Your right, this isnt a bug, NativeBoost is very well tested and works
really nice!

I should reformulate the comment: 'if i new user of Native Boost, and
i copy and paste some Library method, to create a NB method in
smalltalk, and if it happens that that particular method is written
foo(void), then will i be able to know the origin of the DNU ?, that i
should just put foo() ?"

For me it took a while of debugging before i understood the issue,
maybe others less eager to debug will think its a bug? Surely with a
good documentation and examples, it shouldn't be a problem.

Fernando


On Thu, Dec 15, 2011 at 1:23 AM, Igor Stasenko <siguc...@gmail.com> wrote:
> On 15 December 2011 00:12, Fernando Olivero <fernando.oliv...@usi.ch> wrote:
>> I've insist.
>>
>> Because maybe somebody else runs into this bug, and thinks that NB is
>> broken, instead of understanding they should use new C syntax. For
>> examples i was using the latest Pango code.
>
> but this is NOT a bug. maybe a missing feature but not a bug.
> Is it so hard to put empty braces instead of void? :) And besides
> empty braces it is valid C syntax.
>
>>
>> If you want we could raise a warning, suggesting changing the code?
>> (maybe too disturbing).
>>
> no, i just dont understand why complicating a code for nothing?
> You can define a callout to functions with no arguments.
> If you would not be able to do so, then this can be considered a bug.
>
>> Fernando
>>
>> On Wed, Dec 14, 2011 at 2:10 AM, Igor Stasenko <siguc...@gmail.com> wrote:
>>> On 14 December 2011 01:17, Fernando Olivero <fernando.oliv...@usi.ch> wrote:
>>>> Igor, is this a bug?
>>>>
>>>> When parsing methods that send native functions withouth arguments ,
>>>> void, theres a DNU.
>>>> For example in the following method:
>>>>
>>>> ^ self pangoCairoNbCall:#(PangoCairoFontMap
>>>> pango_cairo_font_map_get_default ( void ) )
>>>>
>>>>
>>>> I fixed it like this:
>>>>
>>>> usesMethodArguments
>>>> "first check wether my single argument is void"
>>>> ^(fnSpec arguments size = 1 ==> [fnSpec arguments first class ~=
>>>> NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader
>>>> usesSTStack ] ]
>>>>
>>>>
>>>
>>> Well, the function signature syntax are not strictly following C.
>>> Just use empty parens for functions with no arguments. This is quite
>>> archaic C syntax, which is really not important to support.
>>>
>>> Or i can add this patch if you insist. :)
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.


Reply via email to