Questions tagged [gnu-smalltalk]

GNU Smalltalk is a free implementation of the Smalltalk-80 language. It runs on most POSIX compatible operating systems (including GNU/Linux, of course), as well as under Windows. Smalltalk is a dynamic object-oriented language, well-versed to scripting tasks.

GNU Smalltalk is a free implementation of the Smalltalk-80 language. It runs on most POSIX compatible operating systems (including GNU/Linux, of course), as well as under Windows. Smalltalk is a dynamic object-oriented language, well-versed to scripting tasks.

115 questions
18
votes
5 answers

Is it possible to run Smalltalk scripts from the command line?

I found a (possibly outdated and incorrect) blog post from 2004 which claimed that it was impossible to run Smalltalk scripts from the command line. Has anything changed since then, and is it possible to run Smalltalk scripts from the command line?…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
12
votes
4 answers

Smalltalk public methods vs private/protected methods

I noticed that the Smalltalk language has no concept of private/protected methods. All methods are public. Coming from a Java/C++ background, I've thought of this as a fundamental weakness in the language as any application created in Smalltalk…
9
votes
1 answer

Python's if __name__=="__main__" idiom for GNU Smalltalk?

Does such a thing exist? Ruby: if __FILE__ == $0 main end Perl: unless(caller) { main; } Lua: if type(package.loaded[(...)]) ~= "userdata" then main(arg) else module(..., package.seeall) end
mcandre
  • 22,868
  • 20
  • 88
  • 147
9
votes
1 answer

Compiling 'hello, world' GNU smalltalk

Whenever I set out to learn a language the first thing I do is produce an executable file written in that language (it could be a compiled program or a script) that when run prints 'hello, world' and a newline to…
TheIronKnuckle
  • 7,224
  • 4
  • 33
  • 56
8
votes
3 answers

Images or files in GNU Smalltalk?

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…
Marc
  • 585
  • 5
  • 19
7
votes
2 answers

Importing files in GNU Smalltalk

I'm new to GNU Smalltalk. I know that in most programming languages, there's an import/#include/require command that gives one source file access to the contents of another. My question is, how do I import one file into another in GNU Smalltalk? Any…
Techgineer
  • 153
  • 1
  • 10
7
votes
2 answers

Importing a GNU Smalltalk project into Pharo?

I have about 1800 lines of GNU Smalltalk code I'd like to pull into Pharo. I've started doing it class by class, selector by selector, but it is very time consuming and tedious. Is there a way to bulk import a project? I could easily adjust the…
lurker
  • 56,987
  • 9
  • 69
  • 103
6
votes
4 answers

Smalltalk with GUI on Mac OS X Lion (10.7)

I need some smalltalk with GUI for my homework, and I'm running Mac OS X Lion (10.7). I've seen that unix users usually use GNU Smalltalk and GTK+. I've tried to install them from different versions of sources and all of them give some errors. Then…
Uko
  • 13,134
  • 6
  • 58
  • 106
6
votes
2 answers

What is the correct way to test Unicode support in a Smalltalk implementation?

Given any Smalltalk flavor, how should I proceed to check if Unicode is supported? In case of not having support, how can I detect at which level is missing (VM, font, Converter, etc)?
user869097
  • 1,362
  • 8
  • 16
6
votes
2 answers

Smalltalk variables: why should I declare them?

Basically I can use variables just by assigning something to them, for example: x := something It works fine. But in classes, if I define a new method, but I don't declare the variable, I get an "assignment to undeclared variable x", so I have to…
eva02
  • 61
  • 3
6
votes
2 answers

GNU Smalltalk 80 Debugger. How to debug smallcode code ? Start Debugger?

In GNU Smalltalk 80 it is possible to write smalltalk code in your own plain text editor of personal choice. Therefore, it is very important to debug the code. First you save the file as txt File. Then you open the file from the programmers text…
Zabo
  • 273
  • 1
  • 2
  • 8
6
votes
1 answer

Smalltalk: Checking if a method belongs to a class (or its inheritance hierarchy)

Is there a smalltalk message that will answer with a boolean value if a given method (example: passed with #aMethod) belongs to a given class (or its hierarchy)? I want to say something like — (self containsMethod:#aMethod) ifFalse:[...blah…
Wes Field
  • 3,291
  • 6
  • 23
  • 26
5
votes
2 answers

A Smalltalk implementation with the perfect feature set

I prefer interfacing with programming languages through a standard bash terminal. While Squeak and Pharo are well documented, they don't seem to have a CLI, just a VM GUI. GNU Smalltalk and Slate have a normal CLI but no installers for Linux, Mac,…
mcandre
  • 22,868
  • 20
  • 88
  • 147
5
votes
1 answer

Why adding a collection to itself blows up in Smalltalk?

I wonder why this is not terminating in GNU Smalltalk: s := Set new. s add: s In theory, s should be simply a set containing an empty set. But executing that just loops forever, blowing up the heap. Interestingly, ((s := Set with: 4 with: 5 with:…
micsza
  • 789
  • 1
  • 9
  • 16
5
votes
2 answers

What's the difference between the Array and Literal Array in Smalltalk?

Besides the size. For example: |arr|. arr := Array new: 10 and #(element1,element2, ...)
hogolyo
  • 51
  • 3
1
2 3 4 5 6 7 8