Re: [Newbies] squeak on Linux for amd64 architecture

2007-02-14 Thread Damien Cassou

Baeckham wrote:


Hi,

months ago I used squeak a little bit under Linux x86. Now I got a new system 
with core2duo cpus. So I am on amd64 architecture now. But now I ca not use 
squeak anymore. Is there a amd64 squeak available - on the website I only get 
the one for i686.
 



You have this : http://squeakvm.org/squeak64/

Bye

--
Damien Cassou

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Error "All SqueakMap master servers are down"

2007-01-19 Thread Damien Cassou

jerryw a écrit :
Just this week I have installed Squeak3.9-final-7076.image from the 



Don't know about 7076 image. Do you mean 7067 ?

www.squeak.org website. It starts fine but whenever I evaluate "SMLoader 
open", I see a an alert box pop-up saying "All SqueakMap master servers 
are down" 'map.squeak.org' 'map1.squealfoundation.org' 



this works for me. Can you try again please ?


map2.squeakfoundation.org' - however I can ping them all from my server 
(which is behind a Squid proxy but is otherwise able to contact any 
other http-based server running on any port. I'm being offered an option 
to debug this but I don't know where to start, can anyone advise please? 


Don't know about your network configuration, but you have to know that 
there exists a proxy configuration for Squeak. Open the preference 
browser (world -> preferences & services -> preference browser -> 
category "http proxy").



Did you know there is a squeak image version for developers ? See 
http://damien.cassou.free.fr/squeak-dev/


Bye

--
Damien Cassou
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] FW: Problem printing from Workspace to Transcript

2007-01-19 Thread Damien Cassou

Harry Mueller a écrit :
I've just started looking at Squeak and can't seem to print to 
Transcript. I'm wondering if I'm doing it properly.  
 
I've written,  Transcript show: 'Hello world!'   into the Workspace 
window but nothing shows up in the open Transcript window . 
 
 What am I doing wrong?  


This should work. Here are some steps you have to reproduce:

- open a workspace (world->open->workspace)
- open a transcript (world->open->transcript)
- type your code 'Transcript show: 'Hello World' in the workspace
- execute it with ALT+d or right-click 'Do-it' and the insertion point 
on your code


If you do all those things right, please tell us what is the VM and 
image your are using.


Bye


--
Damien Cassou
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] GUIs in Squeak, advice please

2007-01-16 Thread Damien Cassou

Hi,

Grant Rettke a écrit :

May someone who is or has done GUI development in Squeak recently, may
you please recommend the best way to go about implementing a GUI app?

The swiki is information packed, but I would like to get the
perspective of a human being on this one.


you may want to have a look at the class TestRunner in 3.9 images. To 
run the application : World->open...->Test Runner


--
Damien Cassou
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] [ANN][Squeak-web Image] Version 72

2006-12-10 Thread Damien Cassou

Squeak-web image is an image made for squeak web developers based on
Squeak3.9-final-7067.

If you use it, please tell me.

You can download it here:
http://damien.cassou.free.fr/squeak-web/


Squeak-web includes:


- all packages in squeak-dev image
- seaside (user: admin, password: seaside)

Squeak-web prepares:


- all packages in squeak-dev image
- magritte
- pier
- plotkit
- seasideTesting
- shoreComponents

(prepared packages are packages not loaded in the image, but a simple
click load them)

Future work:


- Wait for feedback
- Prepare more packages
- Write documentation

Please tell me what is your experience with this version. Please tell me
what you want for this image, this is for you.

Also fill in the wiki :
http://damiencassou.seasidehosting.st/seaside/pier

--
Damien Cassou







___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] [ANN][Squeak-dev Image] Version 72

2006-12-10 Thread Damien Cassou

Squeak-dev image is an image made for squeak developers based on
Squeak3.9-final-7067.

If you use it, please tell me.

You can download it here:
http://damien.cassou.free.fr/squeak-dev/

Changes in this version:


* Update ShoutMonticello version
* Prepare Seaside, Yaxo, TraitsOmniBrowser, SVI, FFI, SiXX
* Bug corrections

(prepared packages are packages not loaded in the image, but a simple
click load them)

Future work:


- Wait for feedback
- Prepare Connectors and DiagramBrowser
- Work on squeak-web, an image for web developers (already started,
should publish an image soon)

Please tell me what is your experience with this version. Please tell me
what you want for this image, this is for you.

Also fill in the wiki :
http://damiencassou.seasidehosting.st/seaside/pier

--
Damien Cassou





___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Omnibrowser

2006-12-03 Thread Damien Cassou

Hi,

there is an article about how to create new browsers.

Alexandre or Stéphane, can you help please ?


Bye

Julian Daly a écrit :
How should I start in creating a new browser? I would like to create a 
new one just like the system browser. I have followed the morph examples 
but these are morphs and I am not using Omnibrowser? I want to use 
Omnibrowser. I can’t find any example code for omnibrowser and looking 
at the code does not help.


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Make 3.9 final "window" smaller

2006-11-16 Thread Damien Cassou

Stephen Davies a écrit :

Hi,

This seems like the stupidst question ever, but...

I downloaded the Squeak 3.9 final image.  But when I open in on my 12"
powerbook, the Squeak window is larger than my 1024x768 screen.  So
the bottom and right go off my screen.

How can I make the window smaller?

As far as I know on my mac there isn't a window resize apart from
dragging the bottom right corner, which I can't get to

You may use ALT+CLIC or APPLE+CLIC on the window to move it (just
let the key et the button pressed while you drag the window).
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] code browser - dead tree version?

2006-09-04 Thread Damien Cassou

stéphane ducasse a écrit :
There is a package made by damien cassou that generate nice latex and 
ps format.
It should be on squeaksource.com I do not know the name of the package 
by hearth.


This is SmallAutoDoc. If you need help just ask.
Lukas made something too.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Metaclass hierarchy - Explanation - Part 1

2006-08-30 Thread Damien Cassou

Klaus D. Witzel wrote:

On Wed, 30 Aug 2006 16:58:54 +0200, Damien Cassou wrote:


Hope this is clear. If not, please ask.

>> String class
>> rule 1) tells us that 'String class' is an object.
>> rule 2) tells us that 'String class' is an instance of a class. The
>> class is:
>> Metaclass


Okay, question: have you done an inspectIt an all the expressions in 
your posting.


For example, when I do an inspectIt on the expression (String class), I 
get an instance of Metaclass. In your description, you get an instance 
of Metaclass for (String class class)


I don't understand you.

(String class) is an instance of Metaclass
(String class class) is Metaclass


inspecting an object shows its class as a title.

Can you rephrase please so that I understand.


I might be wrong :-)


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Metaclass hierarchy - Explanation - Part 2

2006-08-30 Thread Damien Cassou

In Smalltalk,

1) Everything is an object
2) Each object is an instance of a class
3) Each class has a superclass but one called ProtoObject (in squeak)
4) A class is the only instance of its metaclass
5) Each metaclass is an instance of the class Metaclass


The browser can inform you what are the super classes of a given class.


The super class of

Collection


is Object. The super class of Object is


ProtoObject


ProtoObject has no superclass.


What are the super classes of metaclasses ? The super class of 
'Collection class' is 'Object class, which super class is 'ProtoObject 
class'. We can see that classes hierarchies and their metaclasses 
hierarchies are parallel.


But metaclasses goes further because 'ProtoObject class' is not 
'ProtoObject' and we said that only ProtoObject has no superclass. What 
is the superclass of 'ProtoObject class' ? This is


Class


And this is perfectly normal: when you say 'Collection is a class', this 
is true. It means, that Collection is an instance of Class or one of its 
subclasses. Same thing when you say 'This blue car in my street is a 
vehicule'. The blue car could be an instance of the class Car which 
could be a subclass of Vehicule.



Imagine you want to add an instance variable to the class Collection. 
You will use something like:


Collection addInstVar: 'newVar'.


You send the message #addInstVar: to Collection. Messages are sent to 
objects and should be implemented in the class of this objects. So, 
#addInstVar: should be implemented in 'Collection class' or one of its 
super classes. This messages is looked up in the hierarchy of 
'Collection class' and an implementation if found in the class Class.



Is this still ok ?
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Metaclass hierarchy - Explanation - Part 1

2006-08-30 Thread Damien Cassou

Hi,

I would like to try explaining what is the metaclass hierarchy of
Smalltalk. This is always something new smalltalkers have problem with.
It would be interesting if an experienced smalltalker read this mail and
correct it when I'm wrong.


To understand this, you have to know the following three rules by heart:

1) In Smalltalk, everything is an object
2) In Smalltalk, each object is an instance of a class
3) In Smalltalk, each class has a superclass but one called Object


(in squeak, Object has a superclass called ProtoObject and this class
has no superclass).


Lets start with the string:


'my string'


rule 1) tells us that this is an object.
rule 2) tells us that this is an instance of a class. Here the class is:


String


rule 1) tells us that String is an object.
rule 2) tells us that String is an instance of a class. The class is:


String class


rule 1) tells us that 'String class' is an object.
rule 2) tells us that 'String class' is an instance of a class. The
class is:


Metaclass


rule 1) tells us that Metaclass is an object.
rule 2) tells us that Metaclass is an instance of a class. The class is:


Metaclass class


rule 1) tells us that 'Metaclass class' is an object.
rule 2) tells us that 'Metaclass class' is an instance of a class. The
class is:


Metaclass


Ok, we have a loop here so the rules are always verified. Cool !
Explanation:


- An object is an instance of a class
- A class is the only instance of its metaclass: String is the only
instance of the metaclass 'String class'.
- Each metaclass is an instance of the class Metaclass.


Hope this is clear. If not, please ask.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] collection enumeration

2006-08-23 Thread Damien Cassou

Bert Freudenberg wrote:



Am 23.08.2006 um 21:15 schrieb cdrick:


Hi all -

not an important question here, more a discussion. I was wondering
which method is the more appropriate (nice and/or efficient) to
enumerate all the elements of a collection and the index of each
elements...


(a)  à la C

(1 to: collection size) do: [:index |
html render: 'Victime ', index printString.
   html render:
collection at: index]

(b) --- indexOf

collection do: [:victim |
html render: 'Victime ', (collection indexOf: 
victim) printString.

   html render: victim]

(c)  keysAndValuesDo:

collection keysAndValuesDo: [:index :victim |
html render: index printString.
   html render: member]

(d)  using a local var

| index |
index := 0.
collection do: [:victim | index := index + 1.
html render: 'Victime ', index printString.
   html render: victim]

What solution would you suggest ?
I think we forget (a) and (d)
I like (c) but maybe (b) is more readable ?

Maybe there is another way ?


(c), though I like #withIndexDo: better since it mimics the #with:do: 
pattern.


I would vote for #withIndexDo: too which has in 'intention revealing 
name' :-)


And, please forget about (b), this is way too slow and wrong.

Slow because the complexity jump from O(n) to O(n²). Remember that 
#indexOf: has to search for the element in all the collection.


Wrong because:

collection := #($a $b $a).
collection
  do: [:each | Transcript
 show: (collection indexOf: each);
 space]

Will print '1 2 1' instead of '1 2 3'. Index answered by #indexOf: if 
the first index on which the object is found.



Bye
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Beginners Digest, Vol 4, Issue 34

2006-08-21 Thread Damien Cassou

[EMAIL PROTECTED] wrote:


Thank you gentlemen

@Damien  you are quite right, networking may be too difficult to begin 
with. It is just that in some languages, e.g. Rebol, fetching http is 
trivially simple. I was hoping it might be similar in Smalltalk.



I'm pretty sure this is simple, I don't know that's all :-)


I tried Rebol some years ago, I even bought a french book. But the book 
was bad and I never learned to like Rebol due to this :-(

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Building the equivalent of wget in Squeak

2006-08-21 Thread Damien Cassou

[EMAIL PROTECTED] wrote:


Hello

I would like to create a simple means of getting the contents of a web 
page, in the same way that wget works.  What I hoped to do was something 
like:


wget url: 'http://...' show.

I found a few classes e.g. Httpurl and also the asUrl method of the 
string class, but I can't quite work out how to put it all together.  As 
it seems like a simple way to start learning Squeak, I wonder if someone 
could point me in the right direction.


I can't help you, but Networking might not be the simplest thing to 
start with :-)

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] FFI, pragma and co...

2006-08-21 Thread Damien Cassou

cdrick wrote:



Pragmas *may* only be implemented for methods. It seems to be the case
in Visual Works. Do you want an explanation for methods ? 



yes if you can :)



Pragmas are annotations for your methods. This annotations allows the 
developer to categorize its methods.


For exemple, Lukas uses naming conventions to retrieve "description" 
methods (in fact, you can now use pragmas but forget that otherwise my 
explanation is useless :-)). The selector has to start with #description 
to be a description selector:


Symbol>>isDescriptionSelector
  "Answer wheter the receiver is a method selector following the naming 
conventions of a  description selector."

  ^ self ~= #description
   and: [ self beginsWith: #description ]


This is a solution. But sometime, you would like to start a method with 
'description' and this should not be a description method (or you do it 
by mistake).


Pragmas can be used to solve this problem. You then will annotate your 
method to tell the system that this methods are description methods. You 
do it like this:


MyObject class>>firstName
  
  ^ MAStringDescription auto: 'firstName' label: 'First name'


Then, when you want to collect all the description methods in a class, 
you will use the methods in the protocol 'finding' of the Pragma class 
(class side).


Pragma allNamed: #description in: yourObject class

This returns a collection of Pragmas (compiled methods, selector and 
class) in which the pragma #description has been used in the class of 
yourObject.



You can use pragmas with arguments too like in:



only literals are allowed as arguments.

With this, you can find all methods using the pragma #selector:inClass: 
and you can do whatever you want with the argument values.


Writing this, I noticed that Pragmas means a lot of things for me (I 
used the word a lot in the mail and for different purposes). I may have 
to read again a documentation about this but I think the idea is here.


Is it clear ?


beacause I use getters and setters for my iv :)



And pragmas won't help you in my opinion, I don't see any relation :-) 
Why don't you want getters and setters ?




Hope this is your last question of the day, I already answered 4 of them 
and I'm tired now :-D



See you soon
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] FFI, pragma and co...

2006-08-21 Thread Damien Cassou

cdrick wrote:
ps: Considering pragma, is there any classical uses that can be 
interesting to do to work at the meta level... like Id' like to tag 
instance variables according to their meaning in my application. I have 
no idea on how to use pragma for that...


Pragmas *may* only be implemented for methods. It seems to be the case 
in Visual Works. Do you want an explanation for methods ?

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] FFI, pragma and co...

2006-08-21 Thread Damien Cassou

cdrick wrote:

(a) Time millisecondsToRun:[5 timesRepeat: [EMAIL PROTECTED]  ->  12

then I commentet the primitive call to see the diffirence in Number>>@
and I saw no difference...
so I put a self halt in @

and the method isn't stopped when I redo (a).

but if I do that in a worspace:

|a|
a := 1. self halt.
Time millisecondsToRun:[5 timesRepeat: [1@(a+1)]].

It stops and then the halt in #@ works ok ...

any idea of what I did wrong ?


The computer optimize some calls by inlining the method code (I don't 
know for #@). If this is the case, the code of #@ is directly written 
into your method and the original code is never executed.


But again, I don't know if this your problem, just an idea
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Changing error message

2006-08-21 Thread Damien Cassou

cdrick wrote:

really interesting...

If I remember well I've seen Stephan saying that it's not always good 
practises tu use exception handling ...


what are the limits ? when to use or when not to use ...

It seems appropriate to me when there is a user entry to control it and 
avoid human input error (WAValidationDecoration in seaside uses 
WAValidationNotification for the Store example for instance) therwise, I 
don't really see...



I often use error handling to detect errors in parameters in the model. 
Most of the time, I assume parameters are valid but sometimes I must be 
sure. Then, if the parameter is not valid I throw (or raise) an 
exception (not using #error: but a self-made subclass of Error). The 
error can be catched when there is something to do or you can let it 
notify the user about a problem (use a string describing clearly the 
problem).

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Collection>>Includes:...

2006-08-21 Thread Damien Cassou

cdrick wrote:



2006/8/7, stéphane ducasse <[EMAIL PROTECTED] 
>:


Hi florent

Read K. Beck idiom on redefining = normally you MUST also redefine hash

the pattern Kent suggested was


Book>>= anBook
(self author = anBook author ) and: [self name = anBook
name] (a)

Book>>hash
self author hash bitXor: self  name hash (b)


I'm aware of that... but I just don't understand what's: 'hash bitXor:'

why (a) is not sufficient ?

hash tables doesn't talk to me too much ;). 
What I imagine is that bitXOr gives a logical (byte) representation ?  
and these are used in a table (hash) to access objects (pointers)?


Set and Dictionaries have a special ways of storing objects. They 
compute a position in an array from a number calculated on the object. 
This number is returned from the #hash method sent on the object and 
manipulated to have an index in the array (using a modulo operator for 
example).


http://en.wikipedia.org/wiki/Hash_table

As an example, you want to store aBook in an empty hash table.

aHashTable add: aBook


image the hash table has an array of size 10 filled with nil because the 
table is empty.


So, when adding, the hash table will compute the index in which the 
object will be stored:



HashTable>>computeIndexFor: anObject
  ^ anObject hash \\ self array size

\\ is the implementation of the modulo function which basically returns 
a number between 0 and the parameter based on the receiver.


Then, the add: method is:

HashTable>>add: anObject
  self array
at: (self computeIndexFor: anObject)
put: anObject.

This is very very simplified but the idea is there in my opinion.

Now, you should find how the hash table can store more than 10 objects. 
Hint: the array does not have to be resized (but sometimes it will for 
efficiency).



Is it clearer ? Feel free to ask more
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Why hasn't Smalltalk been wildly accepted?

2006-08-17 Thread Damien Cassou

Yoshiki Ohshima wrote:

Subject: Re: [Newbies] Why hasn't Smalltalk been wildly accepted?


  It may not be widely accepted, but I definitely think it is *wildly*
accepted!



Congratulations! Nobody noticed this before :-)
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Account association in Squeak

2006-08-17 Thread Damien Cassou

Serdar Sahin wrote:
I know there is not good place for this question but i thought someone 
should have exprience with this.


I want to associate pier and gjallar account system with my open source 
joomla CMS application’s user system. Is it possible ? So, when a user 
log-in joomla, that user should be logged in pier and gjallar. If it is 
possible, what should i do ? Any idea ?



If you use them as different applications, I don't think it is possible 
without using cookies or storing information based on IP address (this 
solution is bad because multiple users can have the same IP in the same 
time).


If joomla is the base application which encapsulates pier and gjallar 
(using #call: or #render:) then it is possible as they will share the 
same session.




(sorry for my english)


It was clear, hope my answer is too :-)
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Serialize domain model

2006-08-16 Thread Damien Cassou

ernst wrote:

Is there an equivalent to VisualWorks Binary Object Storage System (BOSS) in
Squeak? (BOSS can write out the complete object graph to a file and create
it again from the file.)
Thanks
Ernst


Hi,

have a look at this class: RWBinaryOrTextStream

You can then use #nextPut: to write and #next: to read.

Just ask if you want more information


Bye
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: license

2006-08-16 Thread Damien Cassou

Chiara wrote:

Hi, I'm reading the squeak licence, and there are several points tha I
don't fully understand.

"2. Permitted Uses and Restrictions. This License allows you to copy,
install and use the Apple Software on an unlimited number of computers
under your direct control. You may modify and create derivative works
of the Apple Software ("Modified Software"), however, you may not
modify or create derivative works of the fonts provided by Apple
("Fonts"). ..."

**
By "Fonts" it refers to the source of squeak? to the image? to the
original clases?
**



In my opinion, by Fonts, they refer to Fonts as in

http://en.wikipedia.org/wiki/Fonts

Can somebody confirm ?
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Developer theme/image?

2006-08-16 Thread Damien Cassou

Dirk Vleugels wrote:

On 8/11/06, stéphane ducasse <[EMAIL PROTECTED]> wrote:

load the keybinding :)


Do you mean Emacs key bindings from SqueakMap? Do they work for you
(on macosx)? Ctrl-a is still mark-whole-buffer afterwards, not
beginning-of-line 


I heard about a package with vi keybindings that is easy to configure 
for emacs key bindings too. Can't find it however

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Re: Re: error trap

2006-08-14 Thread Damien Cassou

Klaus D. Witzel wrote:

On Sun, 13 Aug 2006 18:31:23 +0200, Damien Cassou wrote:

Klaus wrote:

Perhaps I should add rules of thumb for when to *author* a block of code:

#1 - for a non local return like [^ nil]
#2 - for deferring a computation like [base raisedTo: bigInteger]
#3 - for parameterized "smart" logic like [:x :y | "do something with 
self, x and y"]


Anybody anything for #4 ?

Unfortunately there are, enforced by people who wrote the compiler, 
other rules (not many of them are for the thumb). For an example try a 
printIt on


 ^ true ifTrue: #a ifFalse: [false ifTrue: #b ifFalse: #c]

Again, a "natural" confusion between an object's value and a block's value.


"
 <- argument of ifTrue: must be a block or variable ->
"


In VW, there is no Object>>value method. But #value is implemented in 
Boolean and UndefinedObject. Is this Smalltalk-standard to have #value 
on Object ?

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Packages and dependencies (squeakmap and monticello)

2006-08-13 Thread Damien Cassou
This is a real problem currently. However, someone is working on 
creating debian-like packages for squeak which will just be perfect in 
my opinion.


who?
so far nobody!


Ok, it seems I misunderstood what Damien Pollet told me a month before. 
But, he is working on package dependency and automatic installation, so 
this still answers the question :-)

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Re: error trap

2006-08-13 Thread Damien Cassou
Yes. And, into the other direction, even in good core methods one often 
finds things like


 ^ dict at: aKey ifAbsent: [nil]

There seems to be a "natural" confusion between "object" value and block 
"value". 


What's the problem with that ? Yes, 'nil value' answers nil but 'nil' is 
not a block and #at:ifAbsent: waits for a block (the parameter is called 
aBlock). It is shorter to write 'nil' directly I agree.



What is more problematic in my point of view is code like this:

AbstractLauncher>>parameterAt: parName ifAbsent: aBlock
  "Return the parameter named parName.
Evaluate the block if parameter does not exist."
  ^self parameters
at: parName asUppercase
ifAbsent: [aBlock value]



It may be me (still a beginner), but it looks equivalent to

  ^self parameters
at: parName asUppercase
ifAbsent: aBlock


which is faster and clearer in my opinion.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Packages and dependencies (squeakmap and monticello)

2006-08-13 Thread Damien Cassou

itsme213 wrote:
I am a bit surprised that packages in squeakmap (and monticello?) do not 
seem to be aware of package dependencies. There may be historical or 
technical reasons for this, but for someone coming from Ruby I really 
miss the equivalent of Ruby's "gem" package system:


   gem install foobar

will inspect meta-data on the foobar package, and then locate and 
install any required packages as well if they are not present already, 
before installing foobar. It is also version aware.


Is there a way to do this with squeak packages? Some specific reason for 
not doing this?


This is a real problem currently. However, someone is working on 
creating debian-like packages for squeak which will just be perfect in 
my opinion.


Some package mainteners write scripts that are launched during the 
installation and install the necessary dependencies. Lukas wrote one for 
pier and one for Seaside. Normally, SeasideInstaller and Pier on 
SqueakMap should install the dependencies.



Bye
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Shrinking image

2006-08-13 Thread Damien Cassou

Sergio Gianatiempo wrote:

i wish to know how can i make my image a smaller, looking arround i
tried Smalltalk majorShrinkbut it doesnt work anymore...
what can i do?
what im looking for is the smallest image able to load an run seaside
and scriptaculous.
any idea? any chunck of code maybe?



Lots of people are looking for that. The best thing I can do currently 
is downloading the last 3.9beta, updating it and then I got an empty 
changes file. There may be other things to do too and I would like to 
know what. You should ask on the seaside mailing list.



Bye
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] finding messages after package install

2006-07-31 Thread Damien Cassou

ferriswheel wrote:
some packages open a workspace showing the contents of a 'readme' file 
during or the end of an package install to explain the package 
operations/use.


how does one find/access these files at a latter time.



Try to find the main classe(s) of the package and have a look at the 
class site of this classes. You may find a method containing the readme 
as a string.

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] SqueakMap error

2006-07-30 Thread Damien Cassou

itsme213 wrote:

I just tried to open SqueakMap package loader and got this option:

 "The map on disk is more than 10 days old. Update it from the internet?"

I chose "Yes", and got an error:

 "Reading an instance of ByteSymbol - which modern class should it 
translate to?"


Do you share your sm directory with multiple images ? It may be the 
cause of the problem. Try removing this directory and try again.

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Books

2006-07-29 Thread Damien Cassou

Clichages Haupt wrote:

Hi Tyler,

On 7/18/06, Tyler Rorabaugh <[EMAIL PROTECTED]> wrote:

Im looking for some intro tutorials as well as books any ideas /
recommendations?


on Smalltalk, especially Squeak, I presume?

There is, of course, Stéphane Ducasse's excellent list of free (!)
books, which you can find at
http://www.iam.unibe.ch/~ducasse/FreeBooks.html .


For Smalltalk, I recommand Smalltalk By Example on this webpage.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [SCRIPT] Setting up a 3.9 image for developers

2006-07-11 Thread Damien Cassou

To use this script :

- World menu
- Open...
- File List
- Find the file in the directories and select it
- Select all the file content (Alt+a)
- Do-it (Alt+d)


Ask me if there is a problem or if you have a question or anything else.


Bye


--
Damien Cassou
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] [SCRIPT] Setting up a 3.9 image for developers

2006-07-11 Thread Damien Cassou
Attached to this email, you will find a script that installs a 
ready-to-use image for the developer. It's for 3.9 based images.


Installed packages are:

Refactoring Engine
RoelTyper
Shout
eCompletion
Seaside
Scriptaculous
Magritte
Pier

It changes the color of the insert point too because the default color 
is difficult to see in Squeak (at least for me).



--
Damien Cassou
| map |
Transcript openLabel: 'Transcript'.
map := SMSqueakMap default.
map loadUpdates.

#('AST' 'Refactoring Engine' 'DynamicBindings' 'KomServices' 'KomHttpServer' 
'RoelTyper' 'Shout' 'ShoutWorkspace' 'ShoutOmniBrowser' 'ShoutMonticello' 
'eCompletion' 'eCompletionOmniBrowser') do:
[ :package | 
map installPackageRelease: (map packageWithNameBeginning: 
package) lastPublishedRelease].

#( #('Shout.3.15' 'http://www.squeaksource.com/shout')#('PreferenceBrowser' 
'http://www.squeaksource.com/PreferenceBrowser') #('Seaside2.6b1' 
'http://www.squeaksource.com/Seaside') #('Scriptaculous' 
'http://www.squeaksource.com/Seaside') #('Magritte-All' 
'http://mc.lukas-renggli.ch/magritte') #('Pier-All' 
'http://mc.lukas-renggli.ch/pier')) do:
[:package | | repository version url fileToLoad sortMczs userString 
passwordString|
fileToLoad _ nil.
userString _ ''.
passwordString _ ''.
url _ package second asUrl asString.

repository _ MCHttpRepository location: url user: userString password: 
passwordString.
sortMczs _ [:a :b | 
[(a findBetweenSubStrs: #($.)) allButLast last asInteger > (b 
findBetweenSubStrs: #($.)) allButLast last asInteger]
on: Error do: [:ex | false]].
fileToLoad _ (repository readableFileNames asSortedCollection: 
sortMczs) detect:
[:file | file beginsWith: package first].

version _ repository versionFromFileNamed: fileToLoad.
version workingCopy repositoryGroup addRepository: repository.
repository creationTemplate: 'MCHttpRepository
location: ''', url, '''
user: ''', userString, '''
password: ''', passwordString, ''''.
version load].

Preferences insertionPointColor: (TranslucentColor r: 0.0 g: 0.8 b: 0.0 alpha: 
0.8).
Transcript cr; show: 'Everything installed'; cr.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] About Pier and Squeak

2006-07-10 Thread Damien Cassou

Hi Serdar,

first of all, there is a mailing list dedicated to Smallwiki, Pier and 
Magritte. You can send your questions there if you want.


Then, I advise you to test your image locally before sending it to your 
server as it is always slower to do so.


The command to start the server is:

WAKom startOn: 8080


If you want to control your remote image, you can install 
RemoteFrameBuffer (SqueakMap) on it before an run


WAVNCController initialize

That will allow you to put your image on a server, and on your local 
machine you can install a VNC client to control it remotely.


I'm not sure this answer all your questions. Feel free to ask again :-)
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: >> implementation

2006-07-10 Thread Damien Cassou

Mathieu SUEN wrote:

Ok so It's me who don't know what is Traits


Traits are a very interesting way of writing softwares. You can write 
behavior in something that look like a class without state (namely a 
trait) and use this behavior in the classes you want.


http://www.iam.unibe.ch/%7Escg/Research/Traits/index.html

I recommend you to read 'Traits, composable units of behavior' which is 
short and clear. I found this article very interesting.

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] SqueakMap, Monticello

2006-07-02 Thread Damien Cassou

itsme213 wrote:
I have tried to install some packages from SqueakMap and get errors 
about some pre-requisite dependencies. Is there a loader / packager that 
is aware of such dependencies and will automatically find and install them?


No ! Most of the time, read the comment associated to the package, and 
you will know the dependencies.

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] variableWordSubclass:

2006-06-26 Thread Damien Cassou

> where is "new:" then?

The method whose selector is #new: is implemented on the instance side 
of Behavior and on the class side of some other classes (String, Set, 
Array...).

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] variableWordSubclass:

2006-06-26 Thread Damien Cassou

dv2 _ DynamicVariable new: 2
 
So far I've seen the hierarchy of FloatArray the method "new:" isn't on 
the class side anywhere. This is the reason because you get an error.  


#new: is implemented in Behavior which is the superclass of Class.

FloatArray new: 5

is correct for example
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] variableWordSubclass:

2006-06-26 Thread Damien Cassou

Joaquin Sitte a écrit :

Please can someone explain the behaviour described below?
I wish to create a subclass of FloatArray for a dynamic system 
simulation. When creating the class with #subclass: the method is 
automatically changed to #variableWordSubclass: as follows

> [...]

In my opinion, this is the kind of questions you will more likely find 
answers in squeak-dev.

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] what's the existing projects to save objects?

2006-06-24 Thread Damien Cassou

Hi,


I search to save an object (and the objects which possibly
composed it) onto a storage medium ("serialization"?).
I hope with your great kindness (too much? )  you could give
me some ways to explore or some names of projects...


"Create your object(s)"
myObject _ {'abc' . 3 . $g}.

"Open a ReadWriteStream (not a simple WriteStream, because of a bug?)"
fileStream _ FileStream forceNewFileNamed: 'myObject.obj'.

"Open a ReferenceStream on your ReadWriteStream"
serializeStream _ ReferenceStream on: fileStream.

"Use #nextPut: and #nextPutAll: to put all your objects into the "
"reference stream."
serializeStream nextPut: myObject.

"Close the streams"
serializeStream close.
fileStream close.


"Here are the steps to get your objects back"
fileStream _ FileStream fileNamed: 'myObject.obj'.
serializeStream _ ReferenceStream on: fileStream.
myObject2 _ serializeStream next. "Use #next to get your objects back."
serializeStream close.
fileStream close.

Bye

--
Damien Cassou
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Exemple of pattern

2006-06-21 Thread Damien Cassou

Mathieu SUEN a écrit :

Hi,

I was wondering were I can find some concret exemple of Decorator
pattern in squeak.


I think Seaside and Pier use the Decorator pattern.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] linux squeak startup

2006-06-21 Thread Damien Cassou
In fact, if you launch your application with exec, it exits the shell 
:-) but squeak stays.


stéphane ducasse a écrit :

My unxi is rusty but exec should not kill the process when the shell exits.

Stef


On 20 juin 06, at 16:42, cdrick wrote:


Hi all :)

do you know how to make an init.d script to start squeak each time a 
linux server starts... It's for seaside. For now I use a command line
squeak -nodisplay myImage.image  but when I close the shell, squeak 
stops too


Thanks for all :)

Cédrick
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners




___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] linux squeak startup

2006-06-20 Thread Damien Cassou
do you know how to make an init.d script to start squeak each time a 
linux server starts... It's for seaside. For now I use a command line
squeak -nodisplay myImage.image  but when I close the shell, squeak 
stops too


I think you just have to look at different exemples of scripts in 
init.d/ to understand how to make one. Basically, a simple switch/case 
statement that handles start|stop|restart could be enough.


To make a software stay alive after an exit of the owner, you should 
call it with 'nohup':


# nohup squeak -nodisplay myImage.image


Bye
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [Q] How should one concatenate Strings?

2006-05-10 Thread Damien Cassou
Since using a stream to construct a collection is a very common task, 
there is a nice helper construct for this:


String streamContents: [:stream |
1 to: 1 do: [:i | stream print: i]]

This spares you to declare one temporary variable and is overall more 
readable.


Also, I used the stream's #print: method which will append a string 
representation of its argument - you could, of course, use #nextPutAll:, 
too.


Btw, do *not* put parens around "1 to: 1". Of course this works, but 
writing "1 to: 1 do:" uses the #to:do: message which is way more 
efficient, and a tiny bit shorter to read, too.


Thank you for all this advices. It will help.

--
Damien Cassou

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [Q] How should one concatenate Strings?

2006-05-09 Thread Damien Cassou

If you are building very long strings by using , in an inner loop, it
can be slow because you will have an N squared algorithm.  You can
convert that into a linear time algorithm by writing to an WriteStream
using nextPut: and nextPutAll: and then asking the WriteStream for its
contents.  It leads to a little more complicated code, but on some
programs in can create a dramatic performance improvement.  In
general, though, use "comma", since it is simpler.


You should avoid optimizing your code before making sure it needs an 
improvement. Nevertheless, here is a simple benchmark for the two 
techniques:


[| temp |
  temp := String new.
  (1 to: 10)
   do: [:i | temp := temp, i asString]] timeToRun

Answers  75.202 milliseconds


[| temp |
  temp := WriteStream on: String new.
  (1 to: 10)
   do: [:i | temp nextPutAll: i asString]] timeToRun

Answers 3.169 milliseconds

To get the string back from the Stream, use #contents:

myWriteStream contents

Bye

--
Damien Cassou

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Image Best Practices

2006-05-09 Thread Damien Cassou

Kyle Hamilton a écrit :
...and the absolute newbies here say "How do you do THAT, Mister 
Johnson?" ;)


My reason is that I had a lot of problems with images. They often 
crashed (I was playing with dynamic variables). So, I always store my 
projects using monticello (on squeaksource or directly on my hard disk).


--
Damien Cassou

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Squeak and the Keyboard

2006-05-05 Thread Damien Cassou
I use vi and emacs extensively and I love the fact I can customize the 
way the keys work.


I love emacs too and I was lost when I started Squeak. I tried 
emacs-bindings in squeak without success. Now, I've noticed that I do 
not need the emacs shortcut anymore: it's because of Smalltalk. In 
Smalltalk, you write very few lines of code to express something. Well 
written methods have an average of 7 lines of code (IIRC).


--
Damien Cassou

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Image Best Practices

2006-05-05 Thread Damien Cassou
Finally, let talk browsers. I have been using the standard browser but I 
have seen the Star browser and heard of the re-factoring browser. For a 
new user working on building an app with Seaside, is there a recommended 
browser?


I always work with the refactoring browser because it allows... 
refactorings. You can then rename methods and variables, extract code to 
methods... It's very cool when you pay attention to object oriented design.



--
Damien Cassou

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners