Article View: comp.lang.eiffel
Article #1251Smalltalk to Eiffel translation dictionary
From: Dave Yost
Date: Wed, 21 Dec 1988 18:13
Date: Wed, 21 Dec 1988 18:13
58 lines
1889 bytes
1889 bytes
From: Kim Rochat <kimr@tekcrl.tek.com>
Date: Mon, 7 Nov 88 13:59:10 PST
In translating some Smalltalk-80 code to Eiffel, I found myself needing
reminders on how to translate various expressions. I include my translation
sheet below. I'd be interested in comments on other ways to write
enumerating loops (or generators) in Eiffel. I've written the Smalltalk-80
assignment operator as ":=" instead of "_".
Kim Rochat
kimr@tekcrl.tek.com
Smalltalk to Eiffel Dictionary
Smalltalk Eiffel
--------- -------
instance variables and methods feature
instance variable attribute
method routine
<language constructs>
self Current
b at: i b.entry(i)
b at: i put: j b.enter(i,j)
b := <type> new b.Create
b isNil b.Void
b := nil b.Forget
a := b copy b.Clone(a)
| a | local a: INTEGER
anArray := Array new:10 anArray.Create(1,10);
<send a message "msg" to each object in an array>
anArray do: [: each | each msg] from i := anArray.lower
until i > anArray.upper
loop
anArray.entry(i).msg
i := i + 1;
end
<send a message "msg" to each object in a list>
[aStream atEnd] whileFalse: from aList.start
[aStream next msg] until aList.islast
<or> loop
aCollection do: [: a | a msg ] alist.value.msg;
aList.forth
end
<for loop>
1 to: 10 do: [: i | <code>] from i := 1 until i > 10 loop
<code>;
i := i + 1
end
Technical Details
Message-ID:
<467@grand.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!grand!dayShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!grand!day From: day@grand.UUCP (Dave Yost) Newsgroups: comp.lang.eiffel Subject: Smalltalk to Eiffel translation dictionary Message-ID: <467@grand.UUCP> Date: 21 Dec 88 18:13:00 GMT Reply-To: Kim Rochat <kimr@tekcrl.tek.com> Organization: Grand Software, Inc., 213-650-1089, Los Angeles, CA Lines: 58