[Vm-dev] Translation weirdness
Bert Freudenberg
bert at freudenbergs.de
Fri Mar 15 12:43:57 UTC 2013
On 2013-03-14, at 21:18, Igor Stasenko <siguctua at gmail.com> wrote:
>
> On 14 March 2013 19:27, Bert Freudenberg <bert at freudenbergs.de> wrote:
>>
>> Slang: foo isIntegerOop
>> C: interpreterProxy->isIntegerObject(foo)
>>
>> Slang: interpreterProxy isIntegerObject: foo
>> C: (foo & 1)
>>
>> SmartSyntaxInterpreterPlugin: y u no smart?
>>
> i'd say completely opposite.
You mean, "foo isIntegerOop" should generate "(foo & 1)", and "interpreterProxy isIntegerObject: foo" should generate "interpreterProxy->isIntegerObject(foo)", yes?
That would at least make sense, agreed.
I'd have expected both constructs to result in the same generated code, so they could be used interchangeably.
- Bert -
> when you looking at C source it is important to not lose track of what
> was written in slang.
> and in this regard, expression
>
> interpreterProxy->isIntegerObject(foo)
>
> is preferable because you know exactly what's going on, in contrast to:
>
> (foo & 1)
>
> where you can wonder, whether same expression is written in slang.. or
> it is translation artefact.
> We should avoid ambiguous stuff.. especially since you can always use macros
> so it won't affect any speed whatsoever.
>
>> - Bert -
>>
>
> --
> Best regards,
> Igor Stasenko.
More information about the Vm-dev
mailing list