我对Python、Perl和Ruby这样的语言没有什么经验,但我已经用Smalltalk开发了一段时间。有一些非常基本的Smalltalk类非常受欢迎,它们是跨Smalltalk实现的:
FileStream
ReadWriteStream
Set
Dictionary
OrderedCollection
SortedCollection
Bag
Interval
Array
在Python、Perl和Ruby中,哪些类是等价的或有效的语义替换?我发现有几个语言比较页面比较了语法,但是对于核心库和基本库的翻译似乎没有什么帮助。在
我还想知道,在Python、Perl或Ruby中,是否存在Smalltalk或viceversa中没有的基类或核心类?在
Perl公司
我会用Perl,因为我对Perl和Smalltalk都很流利。在
Smalltalk的字典非常接近Perl的散列类型。字典对键使用对象等价。Perl使用简单的字符串作为键,因此灵活性受到一定限制。在
Smalltalk的OrderedCollection非常接近Perl的数组类型。在
Smalltalk的FileStream有点像Perl的filehandles,从某种意义上说,它们代表到外部文件或设备的数据流。在
就这样,因为Perl只有散列、数组和文件句柄。:)
红宝石
Python
我应该注意到,有一个集合。计数器对象,它相当于Bag。在
相关问题 更多 >
编程相关推荐