smalltalk

Smalltalk web development software

I try to be very cautious with this question. There are at least three different web-development frameworks available in Smalltalk. The most prominent seems to be Seaside but there is also AIDA/Web and Iliad. They seem to be very similiar, but this impresson may be wrong. I wonder who has tried the different tools and can share the pro...

Elegant way to remove the last part of a string?

In Smalltalk, if given the string 'OneTwoThree', I'd like to remove the last 'Three' part, .e., In Squeak method finder notation: 'OneTwoThree' . 'Three' . 'OneTwo'. The best I can come up with is: 'OneTwoThree' allButLast: 'Three' size, but it doesn't feel very Smalltalk-ish, because it uses the substring length, rather than the sub...

Unix crypt() function in smalltalk/pharo

Hello, I want to encode passwords for UNIX accounts using the crypt function. I'm using pharo 1.0. I tried to install the crypto package from squeakmap, but it gaves me an error and the package seem to get partially installed (categories without class). How can I get my password crypted? I'm willing to invoke external code, if it is re...

Using Squeak from a shell

Can I launch Squeak as a REPL (no GUI), where I can enter and evaluate Smalltalk expressions? I know the default image don't allow this. Is there any documentation on how to build a minimum image that can be accessed from a command-line shell? ...

Pharo/Squeak and GemStone?

May I ask who has used this combination and how good that has worked? What about ease of deployment also? Especially interesting would be in conjunction with either Seaside or Aida/Web... It's a pitty that no-one else has commented. Thanks anyway ...

How to tell if a class uses a Trait

If I have a Trait that some classes use but not others, how can I test an object to see if it is an instance of a class that uses that Trait? What I want is something like isMemberOf: or isKindOf: but for Traits. ...

How to manage 2d array in Smalltalk ?

I have a list of point and have to do erosion/dilation operations. I need a kind of 2d-array but can't find how to do in VisualWorks (I know there is a Array2d class in Squeak, but I must use VW). ...

What is the Smalltalk equivalent of Java's static?

What is the Smalltalk equivalent of Java's static fields and methods? IOW, what do the Smalltalkers do when they need class level data and/or methods? ...

What are the key differences between OO in Smalltalk and Java?

What are the key differences between OO in Smalltalk and Java? Please note that I am a Java programmer trying to expand his horizons by exploring Smalltalk. Currently I know almost nothing about Smalltalk except that it's purer than Java. Therefore I'll prefer the answer that shows how various Java concepts map to corresponding Smallta...

Smalltalk equivalent of a factory method?

Are factory methods used in Smalltalk, and if so, how should one go about writing one, as opposed to how they would in Java, for example? Thanks. ...

Smalltalk exotic features

Smalltalk syntax (and features) can be found pretty exotic (and even disturbing) when you come from a more C-like syntax world. I found myself losing time with some I would be interested in learning knowing what you found really exotic compared to more classic/mainstream languages and that you think helps to understand the language. For...

How to redraw a list in smalltalk

I have a List in my smalltalk application that gets updated by user events. The list updates correctly, but it only redraws, repaints, or refreshes whenever the window is forced to redraw. So it'll appear as it is supposed to, but only when I hide and then reshow the window, or drag it off screen and then bring it back on. How do I ma...

Why ifTrue and ifFalse are not separated by ; in SmallTalk?

a > b ifTrue:[ 'greater' ] ifFalse:[ 'less or equal' ] My understanding is that Boolean a > b receives the message ifTrue:[ 'greater' ], and then ifFalse:[ 'less or equal' ] complying to the generalization: objectInstance selector; selector2 But there a semicolon is needed to specify that the receiver of selector2 is not (objectIn...

How to get the bytes that makeup an integer?

In Smalltalk (or at least Squeak and Pharo), is there a portable way to get the bytes that make up an integer, starting with the most significant byte followed by the next-most, and so on, regardless of byte-ordering differences across platforms? ...

Are all Smalltalk implementations compatible?

I'm newbie on Smalltalk. I'm going to try Seaside framework. And Pharo seems best suitable choice for this. My plan is developing on Mac OS X, servicing on BSD. However, there is no BSD port of Pharo yet, but there are some other Smalltalk ports like Squeak. But I'm afraid of any kind of incompatibility. So I'm asking any kind of incomp...

How do I load a picture (image) into smalltalk.

How do you load a picture into smalltalk? I have found several examples of how to display an image once it is a class resource, but can't find a way to import the picture into my smalltalk environment. (I use the word picture to avoid confusion with the smalltalk image) ...

Dollar dollar= (Dollar) object; What does this do?

Dollar dollar= (Dollar) object; What does this snippet in do? Is it even Java? Or Smalltalk? I found it in TDD, which i think was written with Smalltalk in mind. ...

With Traits, should I use a T prefix and if yes put it before or after any other prefix?

When creating Traits in Pharo+Squeak, is it proper to use a T prefix like TMyTrait and if yes, should the T go before any other prefix like TMPMyTrait (where "MP" is the other prefix), or after, like MPTMyTrait ...

How to print Smalltalk code from Pharo/Squeak?

What is the best way to print - syntax colored and well formatted - code from Pharo/Squeak on paper? 1) Is there a way to print directly from within Pharo/Squeak? (i use it on macosx) 2) Is there a way to export syntax colored, well formatted code from Pharo/Squak? 3) Are there external tools to color and format a filed out piece of co...

Is Seaside still a valid option?

Seaside just released a release candidate for the upcoming 3.0 version, so it appeared on my radar again. As I'm currently pondering what web framework to use for a future project, I wonder whether it's something to consider. Alas, most of the publicity for Seaside is from '07, which is probably one or two generations for the web. So I'm...