Syntactical extensions vs. pragmas everywhere

Philippe Marschall philippe.marschall at gmail.com
Sun Aug 20 10:01:18 UTC 2006


2006/8/19, Andreas Raab <andreas.raab at gmx.de>:
> stéphane ducasse wrote:
> >>> I think that point 1) alone illustrates quite clearly why syntactical
> >>> extensions like the FFI should be treated as what they are: Syntactical
> >>> extensions. If text cannot be interpreted correctly by the compiler
> >>> (because for example there is support code missing which makes the text
> >>> intelligible) it should not be accepted. Everything else is a recipe for
> >>> confusion and disaster. This not only holds for the FFI but for *any*
> >>> kind of non-optional, code-generating (or -affecting) syntactical
> >>> extension.
> >
> > But why? seriously I do not understand why overloading  of <...> is a
> > problems. Why the compiler cannot query <primitive: > and do something
>  > specific with it and query <ffi: module:> and do something else and not
>  > query <myOwnPragmas:...>
> >
> > I would really like to know.
>
> Sigh. That's what my first point was all about. Once more: Assuming an
> extension like the FFI (or Sql) how would -without the FFI or Sql
> support loaded- the compiler even know that <cdecl: 'void puts(char*)'>
> has *meaning*? I.e., that it is not a pragma but that it needs to be
> interpreted by some support code that isn't even present?
>
> You, yourself were running into this problem. You didn't have the FFI
> loaded. You tried to put in an FFI spec. (Fortunately) It didn't work
> and raised your attention and let you to ask what is happening. Now
> consider the situation that we would have used pragma syntax and that
> the compiler would have silently accepted that "pragma". It wouldn't
> have *looked* right but not *worked* right. But if you would've asked
> even I would have no way of telling why "puts() doesn't work on your
> machine".

How is that different from the current situation? If I do:
puts: aString
    <cdecl: void 'puts' (char*)>
    ^ExternalFunction externalCallFailed "not self because it's not
implemented in Object"

I get: 'Unable to find function address'

How does that give me a way of telling why "puts() doesn't work on my
machine"?

Philippe



More information about the Squeak-dev mailing list