smalltalk

GNU Smalltalk - Formatting output and disabling GC messages

How do I disable garbage collection messages with GNU Smalltalk 3.0.5 stable? Also, is there a way to remove the quote marks output when outputting strings? Ex: 'test' printNl. prints 'test' rather than test ...

GNU Smalltalk API?

I have recently been learning Smalltalk, mainly by going through the tutorial at gnu.org. While it has been really helpful and I have learned a lot, I would really like an extensive smalltalk API where I could view all of the built in objects and which messages they can receive, and what they will do with those messages. The manual ha...

Returning messages in Smalltalk

I have a Dictionary of objects I have created in smalltalk, which I am iterating over by enumerating it based on the key/value pairs. For value object in the dictionary, I am calling a method on that object. Based on certain conditions, I would like for this object to be able to add a new member to dictionary, and possibly delete anoth...

Run Smalltalk on server without GUI?

Hi! I've got rather distinct question - I'd like to run Smalltalk on a production server without using graphical interface. Is this possible with VW or Pharo (maybe even Squeak)? I've got a VPS hosting without X and would like to have few websites running on Smalltalk, while developing them localy with full-blown Smalltalk env, includi...

Is there a way in a message-only language to define a whileTrue message without recursion or compiler tricks?

Smalltalk has the whileTrue:-Message implemented through recursion (in VisualWorks) or through compiler-inlining (in Squeak/Pharo). Is there a way to define such a method without using one of them? If not, is there a proof for that avaiable somewhere? ...

Browser that does refactoring in Smalltalk Pharo?

The Pharo dev image ships, by default, with a browser that doesn't seem to have any refactoring abilities. What's the most convenient way to transform a fresh Pharo image into something more useful? ...

[Smalltalk] Store List of Instruction

Hi all, I have a design Problem. i have a Drawer class wich invokes a serie of methods of a kind-of-brush class and i have a predefined shapes which i want to draw. Each shape uses a list of instance methods from the drawer. I can have more than 1 brush object. I want to add custom shapes on runtime in the drawer instance, especifying t...

Could SqueakNOS or PharoNOS made to run an iPhone or iPad to Form a DynaBook?

Not considering legal issues I would be very interested if it would be possible to run one of those on the bare metal of the iPad/Phone ARM-Architecture. ...

Problems with classes (super new)

Hi, I've problems to figure it out what's happening in the following exercise, I'm learning Smalltalk, so I'm newbie. Class A>>new ^super new initialize. A>>initialize a:=0. Class B>>new: aParameter |instance| instance := super new. instance b: instance a + aParameter. ^instance B>>initialize b:=0. The problem says wha...

How to halt only if shift is pressed?

Hi, in Pharo I'd like Object>>halt to halt only if shift is pressed, so that I don't break down my image. How do I do that? So, for example, I'd like to be able to add a self halt. into Array>>add:, without losing my image. ...

Is there a dependency injection framework for Smalltalk?

I'm running Pharo and I'm just in a use case that sort of screams for Dependency Injection à la Guice. Is there something similar for Smalltalk? I understand that you can sort of do it all by foot, by just passing in your dependencies explicitly. But that feels awkward and verbose to me. ...

Question About Classic MVC

Hello, In classic MVC the model notifies the view about changes made on it. In C# this means I have to subclass the View I'm interested in and in the subclassed class register to the model's event. For example, if I were to implement MVC using C# and Winforms, I had to subclass TextBox class and then register inside the MyTextBox's cons...

Images or files in GNU Smalltalk?

Hi, I'm new to Smalltalk. I think I understand the basics of the language and now want to start with GNU Smalltalk (as it's free and has bindings for GTK). As I'm coming from the PHP and Java-Corner, I'm not familiar with the concept of the Smalltalk images. And I even read now, that you don't need to use images in GNU Smalltalk. Now I'...

Using fink to install from a website

I want to use fink to install smalltalk. I found this on the fink website. I was wondering if there was some way to install smalltalk from the url (sudo fink install smalltalk does not work). Is there a way to do this? Or do I not understand fink correctly? ...

Is Pharo just a repackaging/rebranding of Squeak?

I'm trying to learn some Smalltalk. First found was Squeak, but since it has been removed from Gentoo ebuild tree because of security problem, so I decided to find an alternative. Then I found Pharo through Seaside project, after I downloaded Pharo 1.0 package, there are actually a SqueakVM inside! So, my question is: Is Pharo just a r...

I need a dictionary-like mapping between characters and other kinds of objects. Which class would be best?

This is in Squeak/Pharo. If I want to have a mapping between Character objects like $a and $b to other kinds of objects, and want to look up those other objects based on the Character, what is the best class to use? Dictionary is an obvious choice, but seems wasteful to be hashing character objects which are basically already numbers. I ...

I'm confused with block in ruby, compared to smalltalk.

What does block in ruby mean? It looks similar with smalltalk, but you can't send messages to it. For example, in smalltalk: [:x | x + 3] value: 3 returns 6. But in ruby: {|x| x + 3}.call 3 will cause SyntaxError. Well, you can pass messages to lambda in ruby, though: irb(main):025:0> ->(x){x+3}.call 3 => 6 So in ruby, block...

How to access the jQuery event object in a Seaside callback

Basically, I want to translate the following into Seaside Smalltalk: $(".myDiv").bind('click', function(e) { console.log(e); }); Besides that I don't want to console.log the event, but access it in my ajax callback. The most promising approach seemed to be something like html div onClick: (html jQuery ajax callback: [:v | s...

How can I get all the methods in a Protocol?

Hello, How can I get a collection of all the (class) methods in a given protocol in smalltalk/squeak/pharo? I'm trying to collect the values returned by a group of methods. I don't want to have to store the methods in an instance or class variable. So I though I could add them to a protocol and in this way to "mark" them. Thanks. ...

Dolphin Smalltalk - adding method

Hi, I am trying to create a custom class in Dolphin Smalltalk. When I open the Workspace, type in and evaluate the code: Object subclass: #Sudoku instanceVariableNames: 'board' classVariableNames: '' poolDictionaries: '' category: 'JiPP SudokuSolver'. everything works fine and the class is created and visible from Clas...