Questions tagged [squeak]

Squeak is a modern, open-source implementation of the Smalltalk language, with a history of being very easy to port across platforms. See https://squeak.org/.

Squeak started in 1996 as a project of Alan Kay and friends at Apple. They wanted an open source Smalltalk with a view to building Smalltalk's replacement.

Among its features:

  • The Virtual Machine is written in (a subset of) Smalltalk.
  • Runs bit-identically across all its platforms.
  • Very easy to port: it runs on Linux, Macs (both old and new), Windows, iPhones, iPads, and even bare metal.
412 questions
2
votes
1 answer

Smalltalk / Squeak message handling method

A pretty short question - how is the message handling method named (the first method that is called on message passing), and in which class it is defined?
user1483597
  • 540
  • 2
  • 4
  • 20
2
votes
1 answer

How to insert an image into a PolygonMorph?

I need to get a texture into a PolygonMorph, but these seem to require an InfiniteForm as color/ filling. The InfiniteForm is no solution as i need to rotate the PolygonMorph later on and moving the PolygonMorph around also has sideeffects on the…
hanneswurstes
  • 273
  • 3
  • 9
2
votes
2 answers

Passing functions as parameters in Squeak

Since Squeak is purely Object Oriented I'm fairly certain that you should be able to pass functions as parameters to other functions, but when I was researching on this I couldn't find any information about this. Is my intuition correct? And if so,…
EpsilonVector
  • 3,973
  • 7
  • 38
  • 62
2
votes
3 answers

How to write a doubledispatch for the instance creation method?

instance creation method, like ClassName new To aid with some details, we could write a = arithmetic method in abstract class, then doubledispatch them in subclasses. could we use that in instance creation? I have tried new but it fail. Leads…
marsrover
  • 424
  • 5
  • 16
2
votes
2 answers

Squeak Monticello character-encoding

For a work project I am using headless Squeak on a (displayless, remote) Linuxserver and also using Squeak on a Windows developer-machine. Code on the developer machine is managed using Monticello. I have to copy the mcz to the server using SFTP…
Bernd Elkemann
  • 23,242
  • 4
  • 37
  • 66
2
votes
1 answer

Squeak: getting the source code of a method in run-time

I'm writing a small program that modifies a method during run-time in squeak. I saw that in squeak there is a method called getSource (defined in CompiledMethod class), that returns the source code of the compiled method. How do I get the source…
2
votes
1 answer

squeak how to use pen goto: and place:

I am making a program in squeak smalltalk and while making it I realized that I didn't know how to use these pieces of code using an array for the x, y values: pen:= Pen new. "to create the pen object first" pen place: 200@200 pen…
2
votes
2 answers

Is there a way of listing all the DoIts which have been done in a Smalltalk session?

Is there a way of listing all the DoIts which have been done in a session in Pharo or Squeak as well as which workspaces they were done in? Are the contents of workspaces also tracked, so they can be diffed?
vfclists
  • 19,193
  • 21
  • 73
  • 92
2
votes
1 answer

Add a new assignment operator

I started using smalltalk and I am trying to add a new assignment operator :>. The current operator used in pharo is no selector so I started to look into the class Scanner where the underscore _ can be enabled for assignments. I've tried to do it…
2
votes
3 answers

How to load Metacello in Squeak?

It is known that Metacello first or main target was Pharo, but it seems now that Squeak 4 is supported. I've tried but fails due a missing method. From the Transcript: Starting atomic load Loaded -> OSProcess-dtl.65 ---…
user1000565
  • 927
  • 4
  • 12
2
votes
5 answers

Smalltalk binding

I'm not very familiar with smalltalk but what I'm trying to do is override another classes 'new' when I initialize my own class. Does that have anything to do with Class>>bindingOf:? Edit: What I'm trying to achieve is: if ObjectA calls new, then…
Itamar Bitton
  • 777
  • 2
  • 7
  • 25
2
votes
1 answer

Method Finder does not find a new method

I am currently following the Squeak By Example book. It shows that when looking for an unknown method one can search the method by the correspondance between its input and its output in the Method Finder (it opens a Selector Browser window). For…
Seki
  • 11,135
  • 7
  • 46
  • 70
2
votes
3 answers

Are literal strings mutable in smalltalk?

1) What is difference between string and string literal 2) a book says 'zero' at: 1 put: $h will fail because literals are immutable but if I do 'zero' copy at: 1 put: $h works because copying a literal string produces another string which is not a…
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
1
vote
1 answer

Squeak: Testing and using streams

I have an object with a message that gets a stream and print into it. My problem is testing that I am printing the right string. I could do it with output redirection and a testing script, but I would rather do it using the assert of the TestCase…
Mugen
  • 8,301
  • 10
  • 62
  • 140
1
vote
2 answers

Keyword messages in smalltalk (Beginner)(Pharo)

I am trying to create a keyword message style method, but I can't figure out how to access the Receiver from inside the method. I am sure this is simple, however I can't find the answer anywhere. What I am trying to implement is redundant, but I…
Uritomi
  • 13
  • 4