smalltalk Questions

5

I was going through an introduction to Smalltalk. In C++, the functions declared inside a class can be called by objects of that class, and similarly in Smalltalk a keyword, termed as message, is w...
Interne asked 28/2, 2017 at 0:45

2

Solved

Like in other programming language, is there a way of running linux shell command in Pharo smalltalk or a simple script ? I would like to have my Pharo image running a script that should be able to...
Revenant asked 16/7, 2018 at 13:35

5

Solved

I cannot understand this piece of Smalltalk code: [(line := self upTo: Character cr) size = 0] whileTrue. Can anybody help explain it?
Hessian asked 30/1, 2011 at 3:3

6

There might exist dialect specific ways, or maybe a general one. I have two dictionaries, let's say: a := {'a' -> 1} asDictionary. b := {'b' -> 2} asDictionary. Now I want to get c as the un...
Hydrangea asked 6/1, 2021 at 15:0

3

Preamble This is about improving message send efficiency in a JIT compiler. Despite referring to Smalltalk, this question applies to most dynamic JIT-compiled languages. Problem Given a message...

1

Solved

Is there a built-in function in smalltalk that takes as input two timespans, and checks whether they intersect? As an example: the two timespans 2018/01/01-2018/01/05 and 2018/01/03-2018/01/10 do i...
Atiptoe asked 17/6, 2023 at 23:17

2

Solved

I am trying to extend Pharo with promises/futures. I came across this website http://onsmalltalk.com/smalltalk-concurrency-playing-with-futures. It implements futures in Smalltalk. However, when I ...
Whitesell asked 18/4, 2018 at 23:14

3

Solved

Let's suppose that I have an object, x, which can accept any one of the selectors, s1, s2, ..., sn. Let's further suppose that the result of any one of these selectors operating on the object is an...
Naiad asked 8/8, 2015 at 19:8

2

In Squeak, is it possible for a GUI program to have multiple windows? For example, if I am making a painting application, is it possible for the "paint palette" and the "canvas"...
Neptunian asked 10/7, 2022 at 7:10

2

Solved

I am learning a little assembly and for my next project I would like to learn how to make an incremental assembler. By "incremental assembler" I mean an assembler that accepts new code wh...
Bibliophage asked 31/5, 2022 at 19:21

2

Solved

I stumbled upon Smalltalk and further downloaded Pharo, because it was recommended. My first impression is very positive. I wanted to port some simple programs I have written in C++ (my main langua...
Pelagic asked 5/12, 2018 at 18:35

5

Solved

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 possi...
Riordan asked 23/6, 2013 at 0:5

4

In Smalltalk, is there a way to search for all methods available (of any object), say, that contain the word convert (case insensitive search), and also contain the word string? (the method name, n...
Emir asked 20/12, 2015 at 17:32

2

I just started learning Smalltalk at uni. I would like to know the difference between the messages & and and: (just like | and or:)
Sweatbox asked 14/9, 2021 at 22:20

1

Solved

I have a string an I would like to be able to take a substring from the middle of it. For example for the string 'abcdefg' I want to get 'cde' (but the exact start and stop could be arbitrary). I h...
Alleviation asked 10/7, 2021 at 4:58

1

Solved

I am learning Pharo and I want to understand if classes/objects like nil which belongs to UndifnedObject class have only 1 instance and act like a singleton, or is a new instance made every time we...
Docilla asked 20/6, 2021 at 21:29

4

Solved

The implementation of Integer>>#factorial in Pharo is: factorial "Answer the factorial of the receiver." self = 0 ifTrue: [^ 1]. self > 0 ifTrue: [^ self * (self - 1) factorial]. sel...
Genuine asked 7/5, 2016 at 14:33

3

Suppose you have a class Foo, and that you want to be able to multiply a Foo by a Number to get another Foo, using ‘@@‘ as the multiplication sign. Since multiplication is commutative, it would be ...
Eteocles asked 1/5, 2021 at 7:10

1

Solved

How to convert information from one object's format to another? In Smalltalk best practice patterns by Kent Beck, he discouraged "adding all the possible protocol needed to every object they m...
Proceeding asked 26/3, 2021 at 7:52

4

Solved

I'm currently puzzling over the response provided by the class method Float>>asFraction and its various forms. Here are a few examples: GNU Smalltalk 0.001 asFraction 1/1000 0.001 asExactFrac...
Traceable asked 18/2, 2021 at 1:47

1

Solved

What is the exact meaning of these characters ←, ≡, ¬, ≠, ⌾, and ∢ and how are used in Smalltalk-80? consider the following expressions: (taken from the smalltalk-80 source code) ^self class ≡ x ≡...
Kirstinkirstyn asked 27/1, 2021 at 9:31

3

I was just wondering if there is a way to work with multiple screens in Pharo or Squeak. I am just switching from VisualWorks to Pharo and am really missing this feature. I am used to having my wor...
Unhand asked 20/12, 2012 at 23:12

1

I wanted to mess around with OSSubprocess (written by Mariano Martinez Peck) from my Pharo 6.1 on my CentOS 7.4. I searched within the Pharo Project Catalog and tried to install it. I got an erro...
Tui asked 18/7, 2018 at 10:11

5

In smalltalk, everything happens by sending messages to receiver objects. Its syntax usually follows the format receiver message, in which receiver is an object that the message is sent to. Now I c...
Bonkers asked 18/10, 2018 at 0:14

8

What is a Smalltalk "image"? Is it like serializing a Smalltalk run-time?
Mazurek asked 24/8, 2010 at 21:22

© 2022 - 2024 — McMap. All rights reserved.