Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!uflorida!mephisto!rutgers!texbell!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.smalltalk Subject: Smalltalk syntax question/quibble Message-ID: Date: 6 Mar 90 16:01:58 GMT References: <147@cnam.UUCP> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 21 I have thought that the Smalltalk syntax for defining a new class was a bit inconsistent with the rest of the language. I'm thinking of how one would write a small object-oriented language, and while I like the Smalltalk syntax, I'm thinking a more elegant syntax for creating new classes or methods would be: name <- Class Subclass: instance_variables name Method: methodname Is: block So the syntax for point would be like: Point <- Magnitude Subclass: #( 'x' 'y' ). Point Method: 'new' Is: [ x <- 0. y <- 0. ^self. ]. Point Method: 'x:y:' Is: [ x0 y0 | x <- x0. y <- y0. ]. Integer Method: '@' Is: [ y | p <- Point new. p x: self y: y. ^p. ]. Etcetera. What's wrong with this picture? (obviously something is) -- _--_|\ Peter da Silva. +1 713 274 5180. . / \ \_.--._/ Xenix Support -- it's not just a job, it's an adventure! v "Have you hugged your wolf today?" `-_-'