(Smalltalk > you) ifTrue: [self postTo: LiveJournal].

Jan 12, 2007 00:53

Been fiddling about with Dolphin Smalltalk. I'm really liking this language. I first figured objects out in Java, and they seemed like a great idea, but certain things just seemed more complex than they needed to be. Smalltalk has no such cruft. Most especially, writing a small class does not necessitate writing a header which is larger than the ( Read more... )

Leave a comment

dour January 12 2007, 18:39:12 UTC
While it's probably a bad idea-from what I've seen, you're generally not supposed to expose the instance methods through the class in a singleton for a couple of reasons-it's thoroughly possible.

Keywords mean something slightly different in Smalltalk than in other languages; they're not flags, they're method names which take arguments. Standard class extension is done by sending a message to an existing class (which is itself a live object). The method designated by this message is inherited from Class. By changing its implementation, you can cause your classes to have different subclassing behavior, or disable subclassing entirely. Class (maybe even Object?) also teaches classes how to tell you what methods they implement, so you can selectively disable or mirror them. It wouldn't be hard to build a second subclassing method, #makeSingleton: , which did all the basic work. It would take a little extra effort to properly integrate it with the class browser, but you could always just send the message in a workspace.

Smalltalk and Lisp have a lot in common, in terms of design philosophies. Neither has control structures in the language; both are fully introspective and mutable at runtime. I think if I were still primarily a commandline jockey, or (especially) if I were using Unix, I'd probably have picked Lisp-in fact, I was on the verge of doing exactly that when I found this blog and decided to follow along (because his goal is my goal, and he's far more experienced).

Reply

plogon January 14 2007, 20:41:16 UTC
are you making a game too?

Reply

dour January 15 2007, 01:36:39 UTC
By fits and starts, yes.

Reply


Leave a comment

Up