From: Konrad Meyer Date: 2007-10-23T13:46:32+09:00 Subject: Re: pop/push, shift/unshift --nextPart1470437.F2NYfBXcZq Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Quoth Simon Schuster: > the inconsistency in naming bothers me. :P I would imagine that it > comes from push/pop being older, and shift/unshift being added later > (probably I would guess that both of these are pre-ruby programming > ideas. I know I've seen push/pop before.) >=20 > I would like to see either push/pop changed to be > something/unsomething, or shift/unshift changed to be um, visualish > ideas of what's going on (or whatever push/pop is.) my preference > would be push/pop changed to something/unsomething. or maybe > front_add, front_del, back_add, back_del. >=20 > just trying to get a gut-grip on these four array processes, and I'm > pushing and popping and shifting and unshifting left and right (and > back and forth?) and it's taking a surprising amount of time to "grok" > them. does anyone think this is a naming convention that could benefit > with some change, or am I just being strange? Push and pop have been around as instructions since the days of asm. The=20 common "visualisation" is to imagine a dinner-plate-stack-holder at a buffe= t.=20 You push plates down into the spring-loaded stack to add more. When you wan= t=20 to remove a plate, you pop it out of the top of the stack. That's probably= =20 not the best description of the idea, but you can always google for push/po= p. HTH, =2D-=20 Konrad Meyer http://konrad.sobertillnoon.com/ --nextPart1470437.F2NYfBXcZq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHHXylCHB0oCiR2cwRAhawAJ90jg5XQk3DgyKBQUKWoFQtUpcXvgCcDYNg sA2ycsG6tcFWifLSreYRL+o= =J4z4 -----END PGP SIGNATURE----- --nextPart1470437.F2NYfBXcZq--