help-octave
[Top][All Lists]
Advanced

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

Re: Octave and Database connectivity


From: Sergei Steshenko
Subject: Re: Octave and Database connectivity
Date: Sun, 23 Sep 2012 11:30:54 -0700 (PDT)




----- Original Message -----
> From: Jordi Gutiérrez Hermoso <address@hidden>
> To: Sergei Steshenko <address@hidden>
> Cc: fork <address@hidden>; "address@hidden" <address@hidden>
> Sent: Sunday, September 23, 2012 6:15 PM
> Subject: Re: Octave and Database connectivity
> 
> On 22 September 2012 07:01, Sergei Steshenko <address@hidden> wrote:
>>  But isn't Octave's struct an equivalent of Python's dict 
> functionality ?
> 
> Sort of. You can only use strings as keys in a struct. You can use any
> hashable type in Python as keys.
> 
>>  See also my code in "struct weirdness" thread.
> 
> See my explanation for why you misunderstand struct arrays in that thread.
> 
> - Jordi G. H.
>

"You can only use strings as keys in a struct" - good enough for me. Even 
though, say, Perl calls by default some kind of internal 'to_string' function 
when a variable is used as a hash key, I'd rather write and call the needed 
'to_string' myself.

Because, for example, I do not want to rely blindly on how, say, floating point 
number is converted into string.

I actually thought of adding a check that keys are strings in my code, and 
error out if they are not.

For example, how one should treat '1' (a number, not a string) as a key ? As an 
integer key ? As unsigned integer key ? As floating point key ? If the latter - 
as single, double or quad precision ? By the way, the precision question apples 
to integers to.

...

Jordi, you might need to reconsider your misunderstandings of my 
misunderstandings.


Regards,
  Sergei.



reply via email to

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