Collections and Stream classes equivalences between Smalltalk, Perl, Python and Ruby?

Perl I'll answer for Perl, since I'm fluent in both Perl and Smalltalk Smalltalk's Dictionary is fairly close to Perl's hash type. A Dictionary uses object equivalence for the keys. Perl uses simple strings for keys, so the flexibility is somewhat limited Smalltalk's OrderedCollection is fairly close to Perl's array type Smalltalk's FileStream is somewhat like Perl's filehandles, in the sense that they represent a stream of data to an external file or device And that's about it, since Perl has only hashes and arrays and filehandles.

:).

Perl I'll answer for Perl, since I'm fluent in both Perl and Smalltalk. Smalltalk's Dictionary is fairly close to Perl's hash type. A Dictionary uses object equivalence for the keys.

Perl uses simple strings for keys, so the flexibility is somewhat limited. Smalltalk's OrderedCollection is fairly close to Perl's array type. Smalltalk's FileStream is somewhat like Perl's filehandles, in the sense that they represent a stream of data to an external file or device.

And that's about it, since Perl has only hashes and arrays and filehandles. :).

Using Hash::Util::FieldHash functions you can get hashes with keys that are numified pointers to objects and other types which survive CLONEing and get GCed along with the object they refer to. – MkV Aug 25 at 2:52 Add the names of the CPAN modules that fit best. – daxim Aug 25 at 11:59.

Ruby FileStream -> File ReadWriteStream -> IO (or other things that duck type like it) Set -> require 'set', then use the Set class Dictionary -> Hash OrderedCollection -> Array SortedCollection nothing similar Bag nothing similar Interval -> Range Array Ruby has no fixed-length collection class.

Python FileStream -> file ReadWriteStream -> file Set -> set Dictionary -> dict OrderedCollection -> list SortedCollection -> no equivalent object (must call sort on a list) Bag -> no equivalent object (must implement using dict) Interval -> no equivalent object (but a range() function exists for making lists) Array -> no equivalent (tuple is read-only, fixed length. List is variable length) I should note, that there is a collections. Counter object for Python 2.7 that is equivalent to Bag.

Heapq is a partially sorted collection. Is array. Array like a smalltalk Array?

Also, I think collections. Counter (Python 2.7) is a Bag. What about slice or islice for Interval?

– agf Aug 25 at 2:29 Python's array. Array is close, but it only holds objects of the same type. I'm not sure how slice could substitute for Interval.

Thinking about it though, xrange may be a more apt equivalent. But, range is turning into an enhanced xrange() in Python 3.0. – David Aug 25 at 2:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions