#perl - Fri 27 Apr 2007 between 14:59 and 15:11

NY Lost Funds



subichanthis is driving me crazy.
integralNo, it doesn't.
YaakovOne is a two element list, one is four.
integralAn array has order (the order from it's indices). Hashes are not ordered by their keys.
buetow(1, "hi" => 2, "bye") # works too i think
integralHe missed '='s or something.
buetow: That's right!
=> is just magic pixie dust, it's really a ,.
subichanyeah i missed '='s sorry
buetow(1 => "hi" => 2 => "bye") # ;)
subichanthat's what i've typed there buetow
no?
integralno.
Consider using a large font.
buetowsubichan: after the (.....) is assigned to an %hash or an @array, its no more the same
Yaakoveval: @a=qw/hi bye/; %h=@a; \@a; \%h
buubotYaakov: {hi => 'bye'}
integralIn someways, you can think of an array as a box that contains a list. Like a scalar variable is a box that contains a scalar value.
Yaakoveval: @a=qw/hi bye/; %h=@a; print for @a; \%h
buubotYaakov: hi bye {hi => 'bye'}
integralTBH, I guess if subichan wants a *big* obvious difference between arrays and hashes, order is the thing
actionCPAN rating: CGI-Ajax rated 2 stars by Aristotle Pagaltzis
CPANrating: CGI-Ajax rated 2 stars by Aristotle Pagaltzis
subichani don't understand the concept of order. i just understand that the assignments up there make groups of values keyed by 1 and 2 in both cases
integralOh dear, an anarchist.
subichanhaha
no really, what do you mean by ordered?
ordered in memory?
phisically?
integralYou can write code which processes them in a well defined order.
Err, well, stronger than that, but that's okay for a start.
subichanoh..
ok thanks.. it's starting to make sense..
actionintegral & dinner, food
integral& dinner, food
subichanthanks integral, have a good dinner
so basically keys in arrays are deduced by order but are not phisically stored in any variable, whereas hash key values do ?
Ani-_a hash has keys, an array has indexes.
Yaakoveval: @a=qw/hi bye no yes/; %h=@a; print for @a; \%h
buubotYaakov: hi bye no yes {hi => 'bye',no => 'yes'}
subichanAni-_: what are indexes?
buetowsubichan: an index is an integer number

Page: 2 9 16 23 30 37 44 51 58 65 72 

IrcArchive

NY Lost Funds