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
1
vote
1 answer

Which SCM for GNU/Smalltalk?

I have been exploring different source code management tools for Smalltalk dialects, and as Pharo has Monticello and Metacello, VisualWorks has Parcels, and VisualAge uses Envy/Developer. Which source code management tools is used primarily in…
user869097
  • 1,362
  • 8
  • 16
1
vote
3 answers

How to subclass OrderedCollection in GNU Smalltalk?

I'm reading a book using VisualWorks and I try to write the code in GNU Smalltalk. I have this: OrderedCollection subclass: Stack [ push: anObject [ self addLast: anObject. ] pop [ self isEmpty ifTrue:…
caisah
  • 1,959
  • 1
  • 21
  • 31
1
vote
4 answers

Smalltalk How to create immutable instance variable?

I have a class with an instance variable var. I don't want the variable to be modified / assigned to a value except when the object is created using a Class method. isImmutable: aBoolean is the method to convert a mutable object to an immutable…
Aditya Kappagantula
  • 564
  • 1
  • 7
  • 21
1
vote
2 answers

Smalltalk own new method

Object subclass: Node [ |value| new [ Transcript show: 'Test'. value := 6. ] getValue [ ^value. ] set:sth [ value := sth. ] ] |data| data := Node new. Transcript show: (data…
Fuv
  • 922
  • 2
  • 12
  • 25
1
vote
1 answer

Troubles with installing gnu smalltalk

im trying to install gnu smalltalk on ubuntu, i downloaded smalltalk from ftp://ftp.gnu.org/gnu/smalltalk and i extracted the folder on the desktop. When i'm into the smalltalk folder and i write "./configure" and all seems to be alright, the…
0
votes
0 answers

Error in parsing .dat file using GNU Smalltalk

I'm getting an error in parsing a .dat file. This is the error I am getting: shapes.dat:1: parse error, expected '(' or '[' or '#' or '{'. The way I am reading the file: ShapeApp >> readShapesFromFile: fileName [ | fileStream lines vec | …
0
votes
1 answer

Why is #at:put: in GNU Smalltalk message of SmallInteger?

While playing around with the Array class in GNU Smalltalk, I was suprised that the #at:put: message belongs to the class SmallInteger instead of the class Array (or any other super class of Array). Why?
Marc
  • 585
  • 5
  • 19
0
votes
1 answer

Why this method's return part is not working

I am trying to write a method which returns a new value. Following code is modified from here: | stripChars | stripChars := [ :string :chars | str := string reject: [ :c | chars includes: c ]. str displayNl. "THIS WORKS." ^…
rnso
  • 23,686
  • 25
  • 112
  • 234
0
votes
0 answers

How to know if a file is binary

I know I can get a list of all files in directory and print their names with code: (Directory working: '.') allFilesMatching: '*' do: [:ff| ff name displayNl] I can use isDirectory to find out if the file is a directory. How can I find out if…
rnso
  • 23,686
  • 25
  • 112
  • 234
0
votes
1 answer

Not able to create instance of object

I am just starting to use gnu-smalltalk. I have taken following code from here to define a class: Number subclass: Complex [ | realpart imagpart | "This is a quick way to define class-side methods." Complex class >> new [ …
rnso
  • 23,686
  • 25
  • 112
  • 234
0
votes
1 answer

how can I set a breakpoint in squeak code?

Hey, friends, Squeak is powerful, I knows that the Debugger in squeak played a central role, now I wanner to set a breakpoint in squeak code, should be self: halt, My problem is that how can I quickly trace into the code-piece where I set an…
parsifal
  • 879
  • 4
  • 12
  • 21
0
votes
1 answer

Smalltalk weird printing error

In order to "pad" a number I'm printing so that it's always a fixed number of characters, I'm making a padding string based off how many integers and in the given number: pad := ' '. (freqVal < 10) ifTrue: [ pad := ' ' ]. ((freqVal < 100) &…
MarksCode
  • 8,074
  • 15
  • 64
  • 133
0
votes
0 answers

reading non printable characters from a file in smalltalk

I have a function which outputs the integer 128 as a character into a file. When I reopen this file to read that character with the next function, it reads the sequence of characters in the form 60 49 54 114 48 48 56 48 62. When I output 127 into…
patzi
  • 353
  • 4
  • 13
0
votes
1 answer

get number of arguments from command line (smalltalk)

Hello im new to smalltalk and was wondering how to get number of arguments passed through the command line. Sorry this is such a basic question.
user1314272
  • 141
  • 1
  • 13
0
votes
1 answer

How to remove an attachMorph of HandleMorph in smalltalk from self

i need your help i am creating a line from a spesific location to mouse location with this code. after click i am trying to remove this line but i have no idea how please help me remove the live after click what should i change ? stk:= (LineMorph…
2Big2BeSmall
  • 1,348
  • 3
  • 20
  • 40