Closed mw66 closed 7 months ago
Do you mean the size of the object in memory?
No, the object's address, in C / C++, for struct Object object
I want &object
.
Try that:
f
local
s: STRING
do
s := "gobo"
print ($s)
end
Note that when compiled with ISE Eiffel, the garbage collector may move objects in memory.
print ? Any IO class need to be inherited from?
tried:
io.put_string ($(zone.implementation))
io.put_integer ($(zone.implementation))
ISE eiffel all reported: Syntax error.
BTW, any io.put_hex_integer
method?
print
comes from ANY
:
print (o: detachable ANY)
-- Write terse external representation of `o'
-- on standard output.
local
s: READABLE_STRING
do
if attached o then
s := o.out
if attached {READABLE_STRING_32} s as s32 then
io.put_string_32 (s32)
elseif attached {READABLE_STRING_8} s as s8 then
io.put_string (s8)
else
io.put_string_32 (s.as_string_32)
end
end
ensure
instance_free: class
end
$s
is of type POINTER
, so io.put_string
or io.put_integer
will not work. There is no io.put_hex_integer
as far as I know.
I can do print($zone)
, but cannot do print($(zone.implementation))
got Syntax error.
have to add local vars:
impl, impl2: EV_WIDGET_I
impl := zone.implementation
impl2 := zone.implementation_upper_zone
print($impl)
io.put_string("%N")
print($impl2)
io.put_string("%N")
Now, it works.
This syntax sucks.
I can do
print($zone)
, but cannot doprint($(zone.implementation))
got Syntax error.
It works with gec
.
This syntax sucks.
You are not supposed to access object addresses in Eiffel in the first place. Eiffel is not C :-)
I know Eiffel is not a raw language like C++, but just want to ask.