pharo

How can I get all the methods in a Protocol?

Hello, How can I get a collection of all the (class) methods in a given protocol in smalltalk/squeak/pharo? I'm trying to collect the values returned by a group of methods. I don't want to have to store the methods in an instance or class variable. So I though I could add them to a protocol and in this way to "mark" them. Thanks. ...

Keep your Pharo image up to date.

Hi, I'm using the latest Pharo beta image (1.1) from http://gforge.inria.fr/frs/download.php/27025/Pharo-1.1-11367-Betadev10.05.1.zip Now, core images have an update button that updates things to the state of the art. What do you do on non-core images? ...

Unix crypt() function in smalltalk/pharo

Hello, I want to encode passwords for UNIX accounts using the crypt function. I'm using pharo 1.0. I tried to install the crypto package from squeakmap, but it gaves me an error and the package seem to get partially installed (categories without class). How can I get my password crypted? I'm willing to invoke external code, if it is re...

Using Squeak from a shell

Can I launch Squeak as a REPL (no GUI), where I can enter and evaluate Smalltalk expressions? I know the default image don't allow this. Is there any documentation on how to build a minimum image that can be accessed from a command-line shell? ...

Pharo/Squeak and GemStone?

May I ask who has used this combination and how good that has worked? What about ease of deployment also? Especially interesting would be in conjunction with either Seaside or Aida/Web... It's a pitty that no-one else has commented. Thanks anyway ...

How to tell if a class uses a Trait

If I have a Trait that some classes use but not others, how can I test an object to see if it is an instance of a class that uses that Trait? What I want is something like isMemberOf: or isKindOf: but for Traits. ...

How to get the bytes that makeup an integer?

In Smalltalk (or at least Squeak and Pharo), is there a portable way to get the bytes that make up an integer, starting with the most significant byte followed by the next-most, and so on, regardless of byte-ordering differences across platforms? ...

With Traits, should I use a T prefix and if yes put it before or after any other prefix?

When creating Traits in Pharo+Squeak, is it proper to use a T prefix like TMyTrait and if yes, should the T go before any other prefix like TMPMyTrait (where "MP" is the other prefix), or after, like MPTMyTrait ...

How to print Smalltalk code from Pharo/Squeak?

What is the best way to print - syntax colored and well formatted - code from Pharo/Squeak on paper? 1) Is there a way to print directly from within Pharo/Squeak? (i use it on macosx) 2) Is there a way to export syntax colored, well formatted code from Pharo/Squak? 3) Are there external tools to color and format a filed out piece of co...

Are Traits good or bad?

This is an open-ended question, but I would like to solicit some opinions from the SO community on Traits; do you think Traits in Squeak/Pharo are a good thing, or should you stay away from them and use composition and delegation instead? I ask because while I know how to use them (thanks to the Pharo book), I am not really sure how acce...

Restrict querying for senders to a certain package

I know there's SOUL. But perhaps Pharo can do the following without any additional packages: How can I restrict searches for senders and implementers to a certain category? Like: I want to see all senders of compile: in OmniBrowser. More generally, how would you go and find the spot where compilation is invoked from OmniBrowser? (I roug...

Making an HTTP request in Pharo and getting the response headers

how can I make an HTTP request and get both the response content and the response headers? ...

Adding stuff to run on startup of Pharo Image

I'd like to add stuff to run at the beginning of a pharo image start-up. Nothing fancy just a call to a class method that is an entry point to my application. I can't find any guides to making smalltalk scripts at startup. Alternatively are there any method which you can add stuff to be done at image startup? ...

How is "self class" used? / How to query the Pharo image?

There are two main reasons for calling "self class": Either for doing user-space things such as invoking static methods, creating new objects or obtaining constants. Or for reflecting on one's self. I'd be curios to know how often each of them occurs. What's the best way to query the currently loaded Pharo code base? Are there built-in...

Smalltalk Variadic functions

Does Smalltalk(especially Squeak/Pharo) have some form of variadic functions? I was just reading about the power of designing your own control statments in smalltalk and while I'm a big fan of ifTrue: ifFalse: I was having a hard time coming up with a good way to implement arbitrary if,if else, if else,...,else statements thinking how u...

How to mark expected failures in SUnit?

How can I mark a unit test in SUnit (or phexample) as expected failures? ...

How do I copy a stacktrace out of the debugger in Pharo?

How do I copy a stacktrace out of the debugger in Pharo? I know there's the Debug.log file somewhere near the image, but I'm far too lazy to navigate out of Pharo, to the file system, find the folder, and browse through a gigantic text file if there's a stack trace right in front of me. ...