liberty-eiffel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Liberty-eiffel] Array with integers. real and strings


From: Paolo Redaelli
Subject: Re: [Liberty-eiffel] Array with integers. real and strings
Date: Tue, 29 Mar 2016 11:39:37 +0200

Oh, I forgot to tell Germán about to_externals, thanks, Cyril.

As we speaking about VARIANT may you please give a quick glance at
https://github.com/tybor/Liberty/commit/09f9471d88568785c68e102ee50d0a561127ca7d ?
I made a little, dirty hack to TYPED_VARIANT to get

Got foobar
Got 38
Got 3.140000
Got Void

Instead of

Got TYPED_VARIANT[STRING]#0x20f9128[]
Got TYPED_VARIANT[INTEGER_32]#0x20fd148[]
Got TYPED_VARIANT[REAL_64]#0x20ff158[]
Got TYPED_VARIANT[STRING]#0x20f9140[]

as naïvely thought that people invoking VARIANT.out may find the former being a more terse representation of those VARIANTs instead of the latter.

Do you think it may be desiderable?

Thanks in advance


2016-03-29 10:46 GMT+02:00 Cyril ADRIAN <address@hidden>:
I agree. As for strings, you may use the `to_external` feature. It returns a pointer to the string's (null-terminated) storage area, i.e. a "char*" for C.

Cheers,

2016-03-29 10:38 GMT+02:00 Paolo Redaelli <address@hidden>:
Il 28/03/2016 21:32, Germán Arias ha scritto:
El lun, 28-03-2016 a las 10:38 +0200, Paolo Redaelli escribió:
Can you give me the name of that function? (And an url of
documentation if you don't mind )
http://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetparam.html


You may use the $ operator which gives a POINTER to the address of an
Eiffel feature, variable or so on.

It's a normally seldom used feature of the language but when dealing
with C you will use it more often.
I will try it.

After a quick read of iupgetparam.html I think you definitifely need to use the $ operator to fill a NATIVE_ARRAY[POINTER]



--
Cyril ADRIAN


reply via email to

[Prev in Thread] Current Thread [Next in Thread]