Thread View: comp.lang.eiffel
1 messages
1 total messages
Started by day@grand.UUCP (
Wed, 21 Dec 1988 18:13
Smalltalk to Eiffel translation dictionary
Author: day@grand.UUCP (
Date: Wed, 21 Dec 1988 18:13
Date: Wed, 21 Dec 1988 18:13
59 lines
1495 bytes
1495 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads