FFI and apicall/cdecl type

Mathieu SUEN mathk.sue at gmail.com
Wed Jul 19 09:01:29 UTC 2006


2006/7/19, Andreas Raab <andreas.raab at gmx.de>:
> Mathieu SUEN wrote:
> > I ask those question because I am adding this to the new compiler.
>
> And why didn't you say so before? See ESR's essay where he talks about
> "describe the goal not the steps". Your questions make a lot more sense
> when you add just that single sentence for explaining why you're looking
> at this code at all.


ok I apologize it is true

> > So I have to follow the same structur to get the ExternalType. But it
> > seem to be not really pretty with nil value.
>
> It is a perfectly reasonable thing to do. The compiler is querying for
> the existence of a type by that name. If there is none, the answer is
> undefined, an UndefinedObject, e.g., nil. What is not pretty about it?


Ok is because it is better to tell not to ask. :)

A think that it is cool to see somthing like this:

aExtType := descriptorClass externalType: aToken value ifAbsent: [
		self interactive ifTrue:[^nil].
		"otherwise go over it silently"
		aExtType := descriptorClass forceTypeNamed: aToken value
]


And #externalType:ifAbsent:keyword do all the stuff of searching throw
all you want (don't want to know).

What do you think?

Math



More information about the Squeak-dev mailing list