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
0
votes
1 answer

How to Retrieve Method's Signature in Squeak

printThisMethodSig: aSomething stack := thisContext stackOfSize: 2. Transcript show: (stack at: 2); cr. stack at: 2 returns the method context of the current method. It is possible to retrieve the compiled method of the current method using method…
Artium
  • 5,147
  • 8
  • 39
  • 60
0
votes
1 answer

How do I compare between ByteString and ByteSymbol in squeak?

I want to execute the following code: methodName := thisContext sender method selector. aClass selectors do: [:current | current == methodName ifTrue: aBlock]. Although the strings are equal, it never steps into the "ifTrue", I've tried converting…
Guy
  • 1
0
votes
1 answer

How do I get the value of a class variable in squeak?

I have a string that contains the name of a class variable that I know exists for class A. I need to get the value of this variable (i.e. dereferencing), how do I do it?
Guy
  • 1
0
votes
1 answer

How do I get the name of the current method in squeak?

As stated above - I need to find the current method's name in runtime. how do I do this?
Guy
  • 1
0
votes
2 answers

Accessing the base part of a derived object

Lets say I am given an object O on some method. This object O is derived from a base Object BaseClass and as such has a part whose type is BaseClass. How can I access this part when I am in this method, which means super wont work because I am not…
TomerZ
  • 615
  • 6
  • 17
0
votes
1 answer

How can I convert a string (of one character) to character in squeak?

How can I convert a string (of one character) to character ?
Ohad
  • 1,563
  • 2
  • 20
  • 44
0
votes
1 answer

How to use the method compile in smalltalk and what parameters can I call it with

I'm trying to add additional functionality to the already defined method "compile" in smalltalk. here is the code I wrote: compile: code notifying: requestor trailer: bytes ifFail: failBlock self log:(self substring: code delimiter: $?). super…
Amer Mograbi
  • 489
  • 1
  • 6
  • 18
0
votes
1 answer

How to print a string that is sent as a parameter to class method in smalltalk

I'm trying to write a class method which recieves a string and prints it. I've tried this: log: aMessage Transcript show: aMessage; cr. and tried to use it as follows: ContractObject log: 'aaa'. (ContractObject is the name of class) but it didn't…
wannabe programmer
  • 653
  • 1
  • 9
  • 23
0
votes
1 answer

Smalltalk x raisedTo: y error

Good day! I Have my report tomorrow and i'm reviewing about Smalltalk. I tried to use the raisedTo: method but it gives me this error: MessageNotUnderstood: Character>>raisedTo: Here's my code: |x y z| x := UIManager default request: 'P1: '. y :=…
Yodism
  • 227
  • 1
  • 5
  • 17
0
votes
2 answers

check if 2 linked list have the same elements regardless of order

Is there any way to check if 2 linked lists have the same elements regardless of order. edit question: I have fixed the code and given some more details: this is the method that compares 2 lists compare: object2 ^ ((mylist asBag) = ((objetc2…
Ohad
  • 1,563
  • 2
  • 20
  • 44
0
votes
2 answers

method that accepts a block and the block accepts an argument

How can I send a block and its argument to a method ? so the method receive the block and the block receives the argument and I run the block in the method iteslf...
Ohad
  • 1,563
  • 2
  • 20
  • 44
0
votes
1 answer

Blocks and ifTrue statement

I want to create a method that gets a block as an argument, and the block gets a parameter as well. If the block returns true it should do something ( for example return 1), and if it returns false it should do something else. this is what I did..…
Ohad
  • 1,563
  • 2
  • 20
  • 44
0
votes
2 answers

initialization of local block variable only at the first time the user call the block

Is there a way to write a block ( which does not get any parameters) which does something only at the first call. I want to initialize a local block variable only at the first time and then change its value each time the user call that block by :…
Ohad
  • 1,563
  • 2
  • 20
  • 44
0
votes
2 answers

How to get brackets without apostrophes from the writeStream?

I tried to get my brakets back from the wirteStream. Sadly the writeStream set two punctuation marks (apostrophes) before and after the brackets. Could someone help me? I found the mistake for this in the class String in printOn and mainly in…
bartak
  • 91
  • 7
0
votes
1 answer

How to check out test code in squeak for the "Inbox"?

What is the process in Squeak to check out some test code for the Inbox, e.g. from the package KernelTests-Numbers? Should I have a local repo and save my extended version in it? YouTube has a good screencast for creating a local repo, but no videos…
bartak
  • 91
  • 7
1 2 3
27
28