Hi,
currently I'm experimenting a bit with Keys. It seems that a Key *can*
be set to a number (floating point), but that this results in a
segfault, when using that key.
So:
.sub main
P0 = new .Key
P1 = new .Hash
P2 = new .Integer
# set the key to a number
P0 = 1.23
P2 = 42
Sam Ruby <[EMAIL PROTECTED]> wrote:
> See: http://xrl.us/emnk
=> dynclasses/pydic.pmc
> Except for fromkeys, get_string, and __new__, the logic is not Python
> specific, and could easily be refactored into a common base class for
> others to use.
Yep. The problem is that all current usage of ha
Leopold Toetsch wrote:
But we should generalize keys eventually. Keys can provide an index for
aggregates and allow chaining of indices for nested aggregates. Arrays
are simple: the key is an integer. But hashes currently don't support
non-string keys easily. We should be able to use arbitrary PMCs
Simon Glover <[EMAIL PROTECTED]> wrote:
> Or rather, a question about keys: what should the following two code
> snippets do?
> 1) new P0, .Key
> set P0, "1"
> set N0, P0
> print N0
> end
> 2) new P0, .Key
> set P0, "1"
> set I0, P0
> print I0
> end
Or rather, a question about keys: what should the following two code
snippets do?
1) new P0, .Key
set P0, "1"
set N0, P0
print N0
end
2) new P0, .Key
set P0, "1"
set I0, P0
print I0
end
At the moment, the first one throws an exception ('Key not a n