Re: Which class provides "print(s: STRING)"?
Philippe Ribet <[email protected]> Sat, 06 Aug 2005 03:44:22 +0200
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I'll try to be short and fix the missunderstanding. Clause "feature
{...}" lists clients able to use the feature in qualified calls.
class C
feature {X}
foo...
then :
a: C
a.foo -- is only valid in X and subtypes of X
Te rule applied in specific cases :
- writing a.foo in C needs C to be subtype of X
- writing Current.foo needs foo to be exported to the current type
All features are available thourough unqualified calls, whatever the
export clause is (it's just internal use). Some not exported feature is
"secret" (see ETL part bellow) because it cann't be called from other
object.
So foo and Current.foo does not have the same behaviour regarding export
rules because the later is a qualified call. Another difference is about
invariant checking (not done on unqualified calls).
May be such explains should be added to the wiki. Any volunteer?
Best regards.
Alexander Rios wrote:
>I think their is no problem here.
>
>I have always understood that an "export clause" is the list of
>classes distinct from Current. An object always has complete access to itself, and so an "import clause" is never necessary, and so no such thing exists.
>
>A feature's export clause is a list of classes. All class instances that conform to a listed class have access to the feature, even when they are not Current.
>
>By "secret feature" I have always understood that it means
>exporting to NONE, and since no class conforms to NONE, the
>feature is NOT exported at all, but this does NOT affect that the feature
>is always imported by Current.
>
>José Bollo <[email protected]> wrote:
>
>
>
>>Le vendredi 5 Août 2005 01:05, Cyril ADRIAN a écrit :
>>
>>
>>>José Bollo wrote:
>>>
>>>
>>>>It comes from ANY but the short command has a bug for some classes like
>>>>ANY GENERAL PLATFORM
>>>>
>>>>
>>>It's not a bug! print is exported to {} so if you want to see it, you
>>>MUST type
>>>
>>>
>>Okay.
>>
>>But where is not the bug?
>>
>>AFAIK exporting to {} is like exporting to {NONE}. then the features are
>>exported to NONE (and their descendants ;^) and will be secret (ETL 1992 2nd
>>edition p102) so can not be used.
>>
>>Currently with SE I can use print in many classes (and even in expanded
>>classes ;^) so the rule "{} means is exported to NONE" is false and i can
>>presume that the rule is "{} means is exported to like Current". Then because
>>the default client of short is ANY that is like Current i can think that
>>short has a bug.
>>
>>Don't you find it funny?
>>I would like to know what are the exact expected rules?
>>
>>
>>
>>>>you can also type
>>>>
>>>>short -client NONE ANY
>>>>
>>>>and you will see the feature print
>>>>
>>>>
>>>Also note that for classes other than ANY, the features inherited from
>>>ANY are not shown except when redefined (otherwise they merely bloat the
>>>display).
>>>
>>>Regards,
>>>
>>>
>>Regards,
>>josé
>>
>>
>>
>
>
>
>
--
Philippe Ribet
The README file said
"Requires Windows 95, NT 4.0, or better."
So... I installed it on Linux!