smalltalk

Smalltalk and IoC

大憨熊 提交于 2019-12-21 09:19:15
问题 I see a lot of IoC frameworks for .Net and Java. Does anyone know why there are no equivalent frameworks for Smalltalk. This is more a philosophy question than anything else. I'm wondering if there is something in the Smalltalk way of doing things that precludes the necessity of having an IoC framework. 回答1: MVC was invented on Smalltalk and is arguably the original Inversion of Control framework. While somewhat more lightweight than its java counterparts, it has the basic concepts of a model

String to Integer Smalltalk

こ雲淡風輕ζ 提交于 2019-12-21 08:01:27
问题 Pretty simple question I need to get an integer from the user and I only know how to get a string from them. So if there is a way to get an integer from the user or to convert the string to an integer please let me know. 回答1: Found it: '12345' asNumber. 回答2: If you are using Squeak or Pharo, learn to use the "Message Finder". Left click on the background, click Tools > Message Finder. Click on the top left pane. Type: '12345'. 12345. Hit Control-S and you have your answer. Specifically, you

String to Integer Smalltalk

北战南征 提交于 2019-12-21 08:01:07
问题 Pretty simple question I need to get an integer from the user and I only know how to get a string from them. So if there is a way to get an integer from the user or to convert the string to an integer please let me know. 回答1: Found it: '12345' asNumber. 回答2: If you are using Squeak or Pharo, learn to use the "Message Finder". Left click on the background, click Tools > Message Finder. Click on the top left pane. Type: '12345'. 12345. Hit Control-S and you have your answer. Specifically, you

Are there any open-source spreadsheet implementations in Smalltalk which are used for production level work? [closed]

时光毁灭记忆、已成空白 提交于 2019-12-21 05:31:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . If nothing exists matching this description, what's the closest I can get? 回答1: Option 1) In Pharo 1.4 or 2.0 I have used SGrid (a.k.a GridMorph) to display hundreds of rows without major performance problems. Install Menu -> Tools -> Configuration Browser -> MorphicGrid (Install) Example | matrix grid rows cols

Is it really all about message passing in smalltalk

戏子无情 提交于 2019-12-21 03:35:23
问题 I'm new to smalltalk and I'm impressed with the fact that there are only just 6 keywords in the language (self, super, true, false, nil & thisContext), and how pure it is in having almost everything as message passing, eg. looping using whileTrue, if/else using ifTrue, etc ... which are way different from what I'm used to in other languages. Yet, there are cases where I just cannot make sense of how message passing really fit in, these include: the assignment operator := the cascading

Squeak or Pharo for the beginning Smalltalker?

核能气质少年 提交于 2019-12-20 10:17:36
问题 I am a Rubyist that is just starting to dabble in Smalltalk and am trying to chose an implementation to experiment with. It seems like Squeak or Pharo would be a good choice, but I'm having trouble finding current information to help decide which one would be better. Much of what I find via Google searches is from a couple of years ago and may no longer be relevant. Is there a clear favorite these days? If not, what are the pros and cons of each? 回答1: To certain extent, it is a matter of

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

僤鯓⒐⒋嵵緔 提交于 2019-12-20 08:35:14
问题 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 Smalltalk concepts and then introduces the Smalltalk concepts that don't exist in Java at all. 回答1: Message passing Smalltalk uses message passing, not method

GNU Smalltalk - Inheritance and Multiple Parameter Methods/Constructors

柔情痞子 提交于 2019-12-20 01:58:33
问题 Say I'm trying to translate the below Java classes to GNU Smalltalk: public abstract class Account { protected String number; protected Customer customer; protected double balance; public abstract void accrue(double rate); public double balance() { return balance; } public void deposit(double amount) { balance += amount; } public void withdraw(double amount) { balance -= amount; } public String toString() { return number + ":" + customer + ":" + balance; } } public class SavingsAccount

What is the Smalltalk equivalent of Java's static?

余生颓废 提交于 2019-12-18 05:45:19
问题 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? 回答1: We use class-side methods/instance variables. A class is an object, after all, so can have methods. For instance, the Rectangle class has a method #origin:corner: so you may write Rectangle origin: 0@0 corner: 100@100 to create a Rectangle. This is just the message #origin:corner: sent to the object called Rectangle (a class is an object!)

How can I add an item in the World-menu of Pharo 4.0?

两盒软妹~` 提交于 2019-12-18 04:59:13
问题 How can I add a new item - Workspace openLabel: 'Workspace' - to the World-menu of Pharo 4.0 ? (What can I say... I prefer Workspace over the new what's-it-called. :-) I've looked at several menu-related items in the Browser, but couldn't really make head or tails of it. I also tried to find where the menu is stored (it must be somewhere, right?), but couldn't find it. Also, how would I go about to add it to one of the existing sub-menues of World-menu, and how could I create a new sub-menu