attribute clause not clear

43 views
Skip to first unread message

Brother Bill

unread,
Jun 10, 2024, 9:57:45 PMJun 10
to Eiffel Users
Using the attribute clause with default create, I would expect that the attribute 42 in that would take precedence.  
This would print 42, rather than 0.
Why doesn't it?
exporting_to_yourself.zip

Ulrich Windl

unread,
Jun 11, 2024, 4:06:12 AMJun 11
to eiffel...@googlegroups.com
Brother Bill,

please explain your issues a bit more rather than attaching ZIPs and ask questions that seem to be out of context when not having unpacked the ZIP.
Also search engines will have a better chance to find specific questions then.

Ulrich

Brother Bill

unread,
Jun 11, 2024, 7:40:31 AMJun 11
to Eiffel Users
My bad.  I think this should have been a support ticket.

Rosivaldo Fernandes Alves

unread,
Jun 12, 2024, 12:56:46 PMJun 12
to eiffel...@googlegroups.com

My bet: an INTEGER attribute is never Void, so it will never need to be initialized (it is zero by default), so the attribute body will never run. Try this instead:

    feature {S6}  -- was {NONE} "Feature of qualified call is not available to client class."
        secret: INTEGER = 42

Rosivaldo F Alves
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/ebd01226-0c6a-4ba3-9838-daf8c8f44332n%40googlegroups.com.

Brother Bill

unread,
Jun 12, 2024, 9:57:58 PMJun 12
to Eiffel Users

Rosiva, it appears that secret is a constant value, rather than a default attribute value.

Rosivaldo Fernandes Alves

unread,
Jun 13, 2024, 10:38:21 AMJun 13
to eiffel...@googlegroups.com
Indeed. My bad.

Rosivaldo F Alves

Em 12/06/2024 22:57, Brother Bill escreveu:
>
> Rosiva, it appears that secret is a constant value, rather than a
> default attribute value.

> (...)
Reply all
Reply to author
Forward
0 new messages