Re: [Newbies] Block and Closure

2009-04-10 Thread Marcin Tustin
Why is this particularly hard for smalltalk? Scheme implementations
manage to do it. Is it simply that it's an afterthought, when it needs
to be designed in from the ground up?

On Fri, Apr 10, 2009 at 7:59 PM, Lukas Renggli reng...@gmail.com wrote:
 In the original Smalltalk, blocks were almost but not quite closures.
 The ANSII standard says they are closures.  As far as I know, all the
 Smalltalks except Squeak make blocks be closures.  So, changing the

 I haven't yet met the Smalltalk implementation that has block closures
 without obvious bugs. Making block closures correct and fast is not
 trivial.

 Lukas

 --
 Lukas Renggli
 http://www.lukas-renggli.ch
 ___
 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


[Newbies] This is an interesting bit of history

2008-10-28 Thread Marcin Tustin
http://www.loriner.co.uk/history1.html

On my walk to work I pass a site marked as the site of the Loriner's trade
in times past. Their history includes (apparently) forced amalgamations, and
pitched battles in the streets of london.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Total newb...

2008-10-14 Thread Marcin Tustin
For C programmers, another way to look at blocks is that it is like passing
a function pointer, except that instead of specifying the address of a
function that you wrote elsewhere, you just write the text of the function.

On 10/14/08, Ron Teitelbaum [EMAIL PROTECTED] wrote:

 Hi Tony,

 You stumbled on one of the most powerful features of Smalltalk.  The Block
 (See BlockContext).  Blocks are a contextual memory space.  They can be
 passed around and do all sorts of great things that Smalltalk programmers
 take for granted.

 The basic form is [] this is a no argument, no code block.  Pretty boring
 cause it does nothing.

 A more advanced form is ['hello']  which is a block with a literal string.
 Still pretty boring.  But at least you can get the string out of the block
 by   aBlock := ['hello'].  ^aBlock value.

 A bit more advanced: [:arg | 'Hello ', arg]  has an argument.
 Now you can do ^aBlock value: 'Ron'.

 You can have more arguments [:arg1 :arg2 | 'Hello ', arg1, ' ', arg2].

 Now you can do ^aBlock value: self firstName value: self lastName.

 Even more complicated is:
 | isLoggedIn |

 isLoggedIn := true.

 [:arg | 'Hello ', arg, ' you are ', (isLoggedIn ifTrue: [''] ifFalse: ['
 not']), ' logged in']

 Now you can do ^aBlock value: 'Ron'. From anywhere and the block remembers
 the context from where it was created.  Pretty cool huh.

 The regular select uses a block too:

 self select: [:anItem | anItem isBlue]

 which uses a do that uses a block

 self do: [:anElement |
aBlock value: anElement) ifTrue ...
 ]

 Blocks are certainly a good thing to learn.

 Happy Coding,
 Ron Teitelbaum

  -Original Message-
  From: [EMAIL PROTECTED] [mailto:beginners-
  [EMAIL PROTECTED] On Behalf Of Tony Giaccone
  Sent: Tuesday, October 14, 2008 2:12 AM
  To: beginners@lists.squeakfoundation.org
  Subject: [Newbies] Total newb...
 
  Ok, so I'm really new to smalltalk. I've done a few basic tutorials
  and have a simple understanding of the syntax. My pervious programing
  experience is mostly java/C with a bit of Objective C in the mix.
 
  I'm trying to figure out how to do what seems like a simple thing.
 
  I have a set, I'd like to find out if an object exists in the set.
 
  In a general form. Let's use the a relatively simple case.
 
  Assume I have classes Rock Paper and Scissors.
 
 
  validHands := Set new.
  validHands add: Rock new; add Paper new; add Scissors  new.
 
  Assume I have a player object which responds to the method
  throwsAHand with an instance of Rock Paper or Scissors.
 
  how do I craft
 
  validHands contains: aPlayer throwsAHand
 
  I know that contains: takes a block, and that this isn't correctly
  done.. but I'm trying to get the a handle on how to do this.
  The intent is to return a boolean, that indicates if the object the
  player threw is in the Set of valid objects that can be thrown.
 
 
  Tony
 
 
  ___
  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] learning Morphic

2008-10-12 Thread Marcin Tustin
Not to forget SeasideXUL!

On Sun, Oct 12, 2008 at 9:50 PM, Michael van der Gulik [EMAIL PROTECTED]wrote:



 On Sat, Oct 11, 2008 at 1:59 AM, Mark Volkmann [EMAIL PROTECTED] wrote:

 My GUI programming background is mainly Java Swing. I'm trying to get a
 feel for programming with Morphic. Browsing through the list of classes, I'm
 not seeing lots of basic things I'd expect. Maybe Morphic is dramatically
 different. I'm trying to find basic things like text fields, checkboxes,
 radio buttons, push buttons, lists, tables, trees, etc.

 I've searched for Morphic tutorials. Most seem to focus on custom graphics
 rather than these basic GUI widgets.

 Where should I start?



 Yea, they're... er... not there. IMHO Squeak has only rudimentary support
 for GUIs, despite people raving about Morphic.

 I tried with Morphic and gave up. For simple stuff, it works okay. If you
 do more complex stuff, you end up wasting too much time making stuff work.
 And then when it does work, it looks like... Morphic.

 I now use ToolBuilder; it should be installed in your image. It was
 originally written as a cross-platform base for making all the Squeak tools
 work on Morphic, MVC, Tweak etc, and was originally designed only to have
 enough functionality to make the basic Squeak tools work. There's some
 example code but otherwise no documentation as far as I know. If you want me
 to, I could write some documentation for it.

 There's also wxSqueak and SqueakGTK, which use native widgets. I don't know
 much about them. You could also use Seaside to make web applications which
 look like anything else does in a web browser, but then you'll be in the
 unfortunate position of making a GUI using a markup language originally
 designed for sharing hyperlinked documents over a stateless network
 protocol.

 Gulik.

 --
 http://people.squeakfoundation.org/person/mikevdg
 http://gulik.pbwiki.com/

 ___
 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] 'locking' an object

2008-10-02 Thread Marcin Tustin
Surely if you have a wrapper class which only holds a reference to a single
object that has all of the data, and that has accessors, then the wrapper
can only use the accessors? The data object could have a flag that causes
all of the accessors to throw an exception when it is set.

Or am I missing something?

On 10/2/08, Randal L. Schwartz [EMAIL PROTECTED] wrote:

  Sean == Sean Allen [EMAIL PROTECTED] writes:

 Sean If you wanted to take a mutable object and make it immutable and be
 able
 Sean to go back again to mutable, how could you do that?

 Squeak doesn't have that sort of capability.  The immutability of a few
 classes is because the VM recognizes them specially, and not available
 at the programmer level without modifying the VM.

 Other Smalltalk VMs are different.  I think both VisualWorks and GemStone/S
 have primitive bits on an object to be informed when a mutation might be
 attempted.

 You can simulate that *mostly* in Squeak by using a proxy object that
 intercepts all messages and looks for the dangerous ones, but that's gonna
 be
 a bit hard to do, and won't be aware of any new code that might call the
 mutating primitives directly.  (*Any* method can call a primitive.)

 --
 Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
 See http://methodsandmessages.vox.com/ for Smalltalk and Seaside
 discussion
 ___
 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] 'locking' an object

2008-10-02 Thread Marcin Tustin
On Thu, Oct 2, 2008 at 6:17 PM, Sean Allen [EMAIL PROTECTED]wrote:

 You'd have to specially code each accessor in that case to check the flag.


Yes. This is unlikely to be a problem unless you have a lot of members.

Alternatively you could adapt the code that generates your accessors to put
in that check, or you could use/adapt magritte to generate your objects.



 Ideally I'd like to be able to step in front of every message send to
 descendent objects and
 decide whether to pass along ( read call ) or reject ( write call ).

 then, all the logic is in one place and the accessors don't need to know
 about what is going on.

 any way to do that?

 i'm ok with the primitive problem as i don't need real immutability. just
 'application level' immutability...
 ideally, without special coding in every accessor method ( that would get
 tedious very quickly ).


 On Oct 2, 2008, at 12:47 PM, Marcin Tustin wrote:

 Surely if you have a wrapper class which only holds a reference to a single
 object that has all of the data, and that has accessors, then the wrapper
 can only use the accessors? The data object could have a flag that causes
 all of the accessors to throw an exception when it is set.

 Or am I missing something?

 On 10/2/08, Randal L. Schwartz [EMAIL PROTECTED] wrote:

  Sean == Sean Allen [EMAIL PROTECTED] writes:

 Sean If you wanted to take a mutable object and make it immutable and be
 able
 Sean to go back again to mutable, how could you do that?

 Squeak doesn't have that sort of capability.  The immutability of a few
 classes is because the VM recognizes them specially, and not available
 at the programmer level without modifying the VM.

 Other Smalltalk VMs are different.  I think both VisualWorks and
 GemStone/S
 have primitive bits on an object to be informed when a mutation might be
 attempted.

 You can simulate that *mostly* in Squeak by using a proxy object that
 intercepts all messages and looks for the dangerous ones, but that's gonna
 be
 a bit hard to do, and won't be aware of any new code that might call the
 mutating primitives directly.  (*Any* method can call a primitive.)

 --
 Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
 0095
 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
 See http://methodsandmessages.vox.com/ for Smalltalk and Seaside
 discussion
 ___
 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


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


Re: [Newbies] constants

2008-09-29 Thread Marcin Tustin
The initialize method on the class side will be called only when *the class*
is initialised. You are thinking of the instance-side initialize method
which is called each time you create an instance.

On 9/29/08, Mark Volkmann [EMAIL PROTECTED] wrote:

 On Sep 28, 2008, at 11:32 PM, K. K. Subramaniam wrote:

 On Sunday 28 Sep 2008 7:26:43 pm Mark Volkmann wrote:

 I think my main issue is scoping. I want to define a constant that is
 associated with a class to avoid name conflicts.

 See classes Color, Cursor or Float for examples of scoped constants:
  Color red
  Cursor wait
  Float pi

 For constants that should be exposed to a few (but not all) classes, use
 pool
 dictionaries.


 Thanks! This brings up another question. Where is a good place to
 initialize a constant? I see in the case of Float pi that it is held in a
 class variable that is initialized in the initialize method. Isn't it the
 case that the initialize method is only called if a Float object is created?
 Also, isn't it called every time a Float object is created? It seems that
 would mean if I followed that pattern for one of my own constants then I
 wouldn't be sure it was set and I'd pay the cost of setting it many times.

 ---
 Mark Volkmann




 ___
 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] constants

2008-09-29 Thread Marcin Tustin
A class is just another object whose own class is Class. I actually don't
know when the class initialisiation method is called after creation. As
usual, if all it does is things you know to be safe, go ahead and call it
manually.

On 9/29/08, Mark Volkmann [EMAIL PROTECTED] wrote:

  On Sep 29, 2008, at 6:00 AM, Marcin Tustin wrote:

 The initialize method on the class side will be called only when *the
 class* is initialised. You are thinking of the instance-side initialize
 method which is called each time you create an instance.



 Wow. I wasn't aware that there was both a class and instance initialize
 method. Thanks for explaining that!


 What causes the class initialize method to be invoked ... and reinvoked
 after I change it?

  On 9/29/08, Mark Volkmann [EMAIL PROTECTED] wrote:

 On Sep 28, 2008, at 11:32 PM, K. K. Subramaniam wrote:

 On Sunday 28 Sep 2008 7:26:43 pm Mark Volkmann wrote:

 I think my main issue is scoping. I want to define a constant that is
 associated with a class to avoid name conflicts.

 See classes Color, Cursor or Float for examples of scoped constants:
  Color red
  Cursor wait
  Float pi

 For constants that should be exposed to a few (but not all) classes, use
 pool
 dictionaries.


 Thanks! This brings up another question. Where is a good place to
 initialize a constant? I see in the case of Float pi that it is held in a
 class variable that is initialized in the initialize method. Isn't it the
 case that the initialize method is only called if a Float object is created?
 Also, isn't it called every time a Float object is created? It seems that
 would mean if I followed that pattern for one of my own constants then I
 wouldn't be sure it was set and I'd pay the cost of setting it many times.

 ---
 Mark Volkmann




 ___
 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



 ---
 Mark Volkmann








 ___
 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] Removing 'dead' instances

2008-09-28 Thread Marcin Tustin
On Sun, Sep 28, 2008 at 5:28 PM, Randal L. Schwartz
[EMAIL PROTECTED]wrote:

  Andy == Andy Burnett [EMAIL PROTECTED] writes:

 Andy Could some kind soul please explain what I am doing wrong here?
 Andy I have a model, called Fspace, which I have created several instances
 of,
 Andy whilst I was testing it.

 Andy Fspace allInstances size reports 9 instances.

 Andy When I run

 Andy Fspace allInstancesDo:
 Andy[:each |
 Andyeach := nil.
 Andy Transcript show: (each value); cr.
 AndySmalltalk garbageCollect]

 Andy The transcript shows that the values are set to nil. However, the
 instances
 Andy don't go away.  So, what am I doing wrong?

 Setting each to nil there does nothing, since you aren't
 updating the object that was originally in each.


This is a pretty common misconception. It seems to come up once a month. I
wonder why - mostly it's not people who are new to programming, who I would
expect to be unfamiliar with the distinction between an object or value and
the location it is stored in.



 You need to tell anyone still holding a reference to your objects
 to let go.  Some advice can be found at http://wiki.squeak.org/squeak/2176

 --
 Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
 See http://methodsandmessages.vox.com/ for Smalltalk and Seaside
 discussion
 ___
 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] SqueakSVN installation problems

2008-09-28 Thread Marcin Tustin
When this was announced, I wasn't really clear on what the point is. Does it
provide anything in the way of source control that Monticello doesn't?

On Sun, Sep 28, 2008 at 11:28 PM, Matthias Korn [EMAIL PROTECTED]
 wrote:

 Hi,

 I was trying to install SqueakSVN from the sar-file provided by HPI at
 http://www.swa.hpi.uni-potsdam.de/projects/ssvn/index.html

 After installing I get the message Everything was installed correctly
 but the SqueakSVN VMPlugin could not be loaded

 Consequently, when trying to create a new project in the
 SVNProjectBrowser I'm getting Error: a primitive has failed.

 Does anyone have an idea on how to fix the VMPlugin?

 I am using sq3.10-7159dev08.03.1.image on Debian Linux with squeak-vm
 1:3.9.8-5.

 Thanks,
 Matthias
 ___
 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] Are setters a good idea?

2008-09-27 Thread Marcin Tustin
The short answer is that you are exposing the internals of the object. If
you have an object that is just a packet of values, great. If you have an
object that will always have e.g. a colour, then possibly great, or possibly
not depending on the domain.

On Sat, Sep 27, 2008 at 7:40 PM, Andy Burnett 
[EMAIL PROTECTED] wrote:

 I read somewhere - can't remember where - that setters are considered evil.
 The argument was that in the real world you can't suddenly change the colour
 of a car, just by settings its colour value. Instead, you have to perform
 some action, e.g. sprayPaintCar: aColour.  Therefore in the OO world, one
 should tackle problems in the same way, i.e. if you want to change the value
 of an instance variable, you have to call some sort of action method, that
 makes sense in the context of the object.

 Without wishing to send  startHolyWar to BeginnersList, do any of the
 experienced developers work this way, or is it just a theoretical position?

 cheers
 AB

 ___
 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] scripts

2008-09-26 Thread Marcin Tustin
Probably worth mentioning that GNU Smalltalk targets that kind of
application. I don't use it, so I can't tell you how nice it is (except that
when I tried it, there wasn't a working gui, so I went away).

On 9/26/08, Randal L. Schwartz [EMAIL PROTECTED] wrote:

  Bert == Bert Freudenberg [EMAIL PROTECTED] writes:

 Bert Am 26.09.2008 um 05:12 schrieb Mark Volkmann:

  Is it possible to run a Squeak program from a terminal window and  have
  access to the stdin and stdout streams from the Smalltalk code?

 Bert Yes.

  If so, pointers to documentation on this would be much appreciated.


 Bert http://wiki.squeak.org/squeak/708

 That's for Squeak creating child processes.  I *think* the question
 is more along the lines of:

   http://wiki.squeak.org/squeak/425

 as in, how can I run Squeak from a command line, and get access
 to the command-line arguments?

 The longer answer is that we generally *don't* do that, so there's not a
 lot
 of discussion or support for it, but there it is.

 --
 Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
 See http://methodsandmessages.vox.com/ for Smalltalk and Seaside
 discussion
 ___
 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] scripts

2008-09-26 Thread Marcin Tustin
Well, doing all the timing management in one place may aid synchronisation.

In any case, I second Subbu's sentiments.


On 9/26/08, Ryan Zerby [EMAIL PROTECTED] wrote:

 I'm a beginner myself, but I would think it would be better to have squeak
 running all the time and let is handle the cron timing, and connecting to
 the database (kind of like a service of it's own). I would think this would
 be easier to debug and maintain as well as being more within the paradigm of
 squeak.

 Better still would be if we got SqueakOS to the point where Squeak noobs
 like myself could use it in place of Windows :)

 On Fri, Sep 26, 2008 at 10:33 AM, Mark Volkmann [EMAIL PROTECTED] wrote:

  On Sep 26, 2008, at 9:29 AM, Bert Freudenberg wrote:

 Am 26.09.2008 um 06:49 schrieb Mark Volkmann:

 On Sep 26, 2008, at 8:03 AM, Randal L. Schwartz wrote:

Randal == Randal L Schwartz [EMAIL PROTECTED] writes:


   Bert == Bert Freudenberg [EMAIL PROTECTED] writes:

 Bert Am 26.09.2008 um 05:12 schrieb Mark Volkmann:

  Is it possible to run a Squeak program from a terminal window and
  have
 access to the stdin and stdout streams from the Smalltalk code?


 And the longer still answer (now that I've noticed access to stdin and
 stdout) is to use an image with OSProcess loaded, and then you can
 get access as follows:

 me := ThisOSProcess thisOSProcess.
 stdin := me stdIn. acts like a Stream
 stdout := me stdOut.
 stderr := me stdErr.
 stderr print: Time now; cr. put the time of day on my stderr output



 Thanks for the example code! Now I think all I need is to find out how
 to launch the code from a terminal window. At
 http://wiki.squeak.org/squeak/1914 I found this.

 To initiate external shell processing, evaluate ''ExternalCommandShell
 stop'', save the image, and restart with ''squeak -headless myImage''.

 It's not clear to me what will be run when that last command is executed
 from a terminal window. Where would I put code like your example code above
 and how does the squeak command know to execute it?


 Perhaps you should let us know what you want to achieve in broader terms
 first. Using Squeak in a headless way to do unix-style stream processing is
 very unusual. It can be done but it is not something I would recommend to a
 beginner.

 This is in contrast to many other languages which are most easily learned
 by creating simple programs writing to stdin/stdout. The power of Squeak is
 in the system (the development tools and frameworks), not so much the
 language (which is powerful, too, but not really what sets Squeak apart).




 I'm really trying to learn about all aspects of Squeak, but at the moment
 I have a task where I need to query a relational database and output an XML
 representation of a subset of the data. This needs to be invoked from a cron
 job, so if I can run my Smalltalk code from a terminal window then I'll be
 set. I know I could do this using many other languages such as Java or Ruby.
 However, since I'm trying to learn Smalltalk and Squeak at the moment, I
 thought I'd use those as part of the learning process.

 ---
 Mark Volkmann





 ___
 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] Collection in Smalltalk

2008-09-24 Thread Marcin Tustin
You need to break this down into its component parts:
Write a method that tells you score of a character
Write a method that tells you the score of a string (hint: use inject:into:)
Write a method that tells you the dollar words (hint: use select: and
splitOn:)

2008/9/24 Alex Chi [EMAIL PROTECTED]

 Hi guys,

 I am just beginner in Smaltalk and I have some problem with collection in
 smalltalk.
 For this problem I have to define the value of an alphabetic character
 based on its location in the alphabet. So 'a' and  'A' each have value 1,
 'b' and 'B' each have 2, etc. Non-alphabetic characters can be considered to
 have value 0.
 The value of a word is the sum of the value of all its characters. So
 'Smalltalk' has value 101 and 'abc' has value 6.
 A dollar word is a word whose value is 100.  I want to add a method to the
 String class that returns all the dollar words in the string.

 So for example if the input is 'SmallTalk' the result is ('SmallTlk'
 'SmllTlk').

 Please kindly help me guys. Really appreciate your help.

 Thanks.


 ___
 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] Iterating and removing items from OrderedCollections

2008-09-18 Thread Marcin Tustin
Would this be O(n^2) to remove all nils?

In any case, if this is a conveyor belt, then you should almost certainly be
using a linke data structure, and iterate over the structure to delete the
unwanted links.

On 9/18/08, Bert Freudenberg [EMAIL PROTECTED] wrote:


 Am 18.09.2008 um 10:06 schrieb Ian J Cottee:

 Hello all

 I've got an OrderedCollection that is normally a fixed size (let's say
 10 elements). Each element in the collection is another an object or
 nil. So for example, at a point in time it might look like

  [nil, nil, Object, nil, Object, Object, nil, nil, Object, nil]

 What I want is to be able to resize the collection. Making it bigger
 is no problem for me, I can just add nils to the end of the
 collection. Making it smaller is involving a little bit of pain. I can
 see ways of doing it but theyr'e not elegant and I'm sure there are
 cleaner ways of doing it. If I made the above queue smaller I'd
 basically remove the nils starting from the beginning. So a resize to
 size 7 would give me

 [ Object, Object, Object, nil, nil, Object, nil]

 i.e. the first three nils have been removed.

 Does anybody have any comments on appropriate code to handle this? If
 not, I'll go with the ugly stuff but it would be nice to know the
 correct SmallTalk way.

 Many thanks for any suggestions.



 I guess it doesn't get much more elegant and efficient than

start := coll findFirst: [:each | each ~~ nil].
coll removeFirst: start-1.

 ... unless you add a specific method to OC.

 - Bert -


 ___
 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] Iterating and removing items from OrderedCollections

2008-09-18 Thread Marcin Tustin
On 9/18/08, Yoshiki Ohshima [EMAIL PROTECTED] wrote:

 At Thu, 18 Sep 2008 10:00:15 +0100,
 Marcin Tustin wrote:
 
  Would this be O(n^2) to remove all nils?

 Not in a way it matters.  OrderedCollection moves items not eagarly.


Do you mean that it will do a lazy delete?


 In any case, if this is a conveyor belt, then you should almost certainly
 be using a linke data structure, and iterate
  over the structure to delete the unwanted links.

 No in two reasons; 1) he wasn't talking about removing items in the
 middle


Look at the original example.

 and 2) OrderedCollection is usually more efficient than the
 naive LinkedList, as less dereferencing.  (And, it could get more
 benefits from using array manipulation primitives like
 replaceFrom:to:, but it can't at least for addFirst:.)


I think this would be an empirical question.


-- Yoshiki
 ___
 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] Good practice for modeling model tools

2008-08-29 Thread Marcin Tustin
Have you looked at Magritte?

On Fri, Aug 29, 2008 at 8:04 AM, Anders Janmyr [EMAIL PROTECTED] wrote:

 Hi,

 I would like some thought on what is a good way to model model tools
 in Smalltalk.

 Clarification
 The user should be able to create classes.
 The classes contain named variables.
 The variables can be described (typed) with data such as type (String,
 Date, Company) and multiplicity (1, 2..5, 4..)
 I also want to attach behavior to the classes.
 I would also want to be able to refactor the classes, preferably with
 the existing tools

 Example:
 Person
  name:String:1
  mother:Person:1
  father:Person:1
  children:Person:0..

 Process
  name: ImportPeople
  executeMethod: code for importing people into my model

 Should I model the users models as Smalltalk objects or should I make
 my own parallel hierarchy.
 Should the Person above be dynamically created as a smalltalk class:

 Person
  name:
  mother:
  ...

 or should I use
  MyClass
name: Person
instVars: #(name mother ...)



 Any help will be appreciated.

 Anders

 --
 http://anders.janmyr.com/
 ___
 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] The Bridge Playing example

2008-08-25 Thread Marcin Tustin
For anyone who's interested, here's an implementation with the cards
represented as integers (or wrapping integers). Perhaps this could be the
basis of a super-compact representation. In any case, sorting hands becomes
simpler, but either dealing (creating a card object) or checking that a play
is legal becomes more involved (because at some point you would have to
reconstruct the symbolic information regarding suit and rank).

Alternatively, if you want to make the deck bridge-specific you could change
the undealt variable into an Array or OrderedCollection, and after shuffling
treat each of the quarters as belonging to a specific hand. Again, more
compact, less simplicity. Taking something out of the hand could be
represented by replacing that card's integer with 0 in the deck/hand array.

Another alternative would be to use an ordinary representation for
shuffling etc. then write that into a bit-packed representation with each
two bits representing a player, as the original questioner wanted. Some
utility classes could go over that to make handling such a thing look like
an array of players, and use a formatting method similar to the one used in
the attached code.


PlayingCards.st
Description: Binary data
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Smalltalk is a Mystery to Me

2008-08-22 Thread Marcin Tustin
On Fri, Aug 22, 2008 at 1:30 AM, [EMAIL PROTECTED] wrote:

  I have had a curiosity about Smalltalk for many years so I recently
 downloaded and installed Squeak. That's when the trouble began. I have
 written applications that deal bridge hands and either display the hands on
 screen or save them in a couple of different formats. I originally wrote the
 'words' in Forth. I later tried Ruby and rewrote most of the programs in
 Ruby. I did it as a learning experience. I sat out to do the same thing in
 Squeak, again as a learning experience, but have made virtually no progress.
 I create the class 'Bridge' with the subclass of dealer. I try to initialize
 by filling a byteArray with 52 numbers, 0 through 51.


Woah...what? This doesn't really make any sense.


 I tended to create additional methods to shuffle and deal the cards to four
 more byte arrays named north, east, south, and west. Eventually I will need
 another method to stack the deck. I will also need a counter to keep track
 of the deal number.

 I can't get started, and I mean zero progress, because I can't create and
 load deck. It seems like the documentation is never quit up to date. I read
 about curly braces and tried deck := {0. 1. 2. ... }. When I try to accept
 it, first deck is questioned and then after deck I get something about not
 expecting anything else.


This is because deck is undeclared, and then because you have a syntax
error.


 I know there is a word 'asByteArray:' and I assume a number would specify
 the size of the array but nowhere can I find anything about the order in
 which the information should be provided. I tried deck asByteArray: 52 but I
 don't know if it worked. If it did work, how do I load the bytes into it?
 How do I look at a byte in a particular location in the array? Can I remove
 a byte from position x and/or insert a byte at position y and everything
 moves to accommodate the change.


First of all, are you familiar with the syntax?

Squeak by example will help guide you through looking at classes, and seeing
what methods they have etc.


 In Forth and Ruby, I was able to store the hands as a 2D bit array, 4 suits
 and 13 bits. If the card was present the bit was set. When I dealt the
 cards, the appropriate bits were set.. This worked really well. The suits
 came out already sorted. The strength of a suit turned out to be related to
 the value stored for the suit. The number of cards in the suit could be
 found by counting set bits. I have yet to find bit-manipulating words in
 Squeak/Smalltalk.

 As an aside, the least number of bits that must be used to store a complete
 deal is 104 or 13 bytes. The bits are arranged in 52 2-bit groups. The
 position in the array represents the value of the card and the bits
 determine which hands gets the card represented by that position. When you
 shuffle the 2-bit groups must be kept in tact. I could easily do this in
 Forth but could not do it in Ruby. If you are going to save a few million
 hands, it is nice to be able to do so in this most compact form.

 If I could just figure out where to find the answers to these beginner
 question, I would really appreciate it. It would also be nice if I could see
 some examples of these methods.

 Charlie



I would recommend that you create a card class, with a member variable that
represents the suit (probably as a symbol) and a second member variable that
represents the card in the suit. Create a class method that returns new
instances (eventually have it throw an exception if something out of the
range of what is acceptable is created) and have a second class method that
creates a collection of cards that contains all the cards, in order. You can
use the methods on the appropriate collection to shuffle it.

Once you've built something working on that, you can try to optimise
storage, either on disk or in memory.





 --
 It's only a deal if it's where *you* want to go. Find your travel deal *
 here* http://information.travel.aol.com/deals?ncid=aoltrv000547.

 ___
 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


[Newbies] htmlcssparser package/discovering size of objects

2008-07-30 Thread Marcin Tustin
Hello everyone, a slightly involved and multi-part question:
I'm using the package at http://www.squeaksource.com/htmlcssparser (HTML/CSS
Parser, or the parser) to scrape multiple pages (in fact about two or
three a day, and about a thousand existing pages), so I can extract parts of
them to put into an rss feed. If I let the root object for a parse (the
Validator's dom object) be garbage collected, none of the rest of the parse
tree really works (because then other objects only referred to weakly get
collected, AFAICT).

So, my first question is whether there's a way to assess what kind of memory
overhead there would be for keeping each of these objects hanging around
indefinitely.
My second is whether anyone has any advice for another way to do it - by
using a different parser, or by copying the data into a different structure
somehow, or something else.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Linked list structure?

2008-07-28 Thread Marcin Tustin
I am aware of LinkedList. It does not meet the criterion of accepting items
whatever their protocol.

On Mon, Jul 28, 2008 at 7:12 AM, David T. Lewis [EMAIL PROTECTED] wrote:

 On Sun, Jul 27, 2008 at 10:27:08PM -0400, Marcin Tustin wrote:
  Is there - either as standard, or freely downloadable - a datastructure
 that
  is ordered, has constant-time appends of items, requires no particular
  protocol of the items stored, and can be iterated over (without
 allocating a
  new structure) starting with the first item added, proceeding to the next
  item added? I.e. has the characteristics of a linked list structure in
 most
  other datastructure libraries?

 Have a look at class LinkedList. This is one of the kernel classes in
 Squeak
 and is used by ProcessorScheduler to manage processes (the threads within
 a Squeak image, instances of class Process). A Squeak Process is
 implemented
 as a subclass of Link, and it is kept as an entry in the linked list. Try
 evaluating Processor explore to look at the singleton instance of
 ProcessorScheduler
 that manages these linked lists.

 Dave

 ___
 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] Re: Linked list structure?

2008-07-28 Thread Marcin Tustin
Yes. I first tried to subclass LinkedList, but I had some trouble with funny
behaviours turning up in do:, although I suppose that has probably been
eliminated here by using not trying to use super do: as I did. (By funny I
mean ending up calling element on the result of element).

On Mon, Jul 28, 2008 at 10:04 PM, nicolas cellier [EMAIL PROTECTED]wrote:

 Marcin Tustin a écrit :

 I am aware of LinkedList. It does not meet the criterion of accepting
 items whatever their protocol.


 You are right, current implementation of LinkedList is very specialized and
 restricted.
 Creating Links transparently would be a plus.
 Hey, we can use a Dictionary without being aware of Association!

 I am not aware of such implementation, but wouldn't be surprised it already
 exists. Rather than a long research, it is easier to DIY.

 I provide an untested quick first implementation as an example.
 This implementation uses already existing StackLink transparently.
 This could of course be completed with addLink: removeLink: etc...

 Reading code enabled me finding http://bugs.squeak.org/view.php?id=7136

 So a prerequisite is:
Installer mantis ensureFix: 7136.

 Last, as all code I publicly released in Squeak until now, consider this
 code as MIT. Change it, republish it, sell it or throw it away at will.

 Cheers

 Nicolas

 'From Squeak3.10beta of 22 July 2007 [latest update: #7159] on 28 July 2008
 at 10:48:46 pm'!
 LinkedList subclass: #TransparentLinkedList
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Collections-Sequenceable'!
 !TransparentLinkedList commentStamp: 'nice 7/28/2008 21:47' prior: 0!
 I represent a collection of links, which are containers for other objects.
 Using the message sequence addFirst:/removeLast causes the receiver to
 behave as a stack; using addLast:/removeFirst causes the receiver to behave
 as a queue.

 Unlike super, users won't see the Link objects, like users of Dictionary do
 not need to know about Association.
 That's why i am called TransparentLinkedList.!


 !TransparentLinkedList methodsFor: 'adding' stamp: 'nice 7/28/2008 22:47'!
 add: anObject after: otherObject
Add anObject after otherObject in the list. Answer anObject.
If otherObject is not in the list, then raise an error.

| otherLink |
otherLink := self findLinkFor: otherObject ifAbsent: [^self error:
 'otherObject is not in this list'].
super add: (StackLink with: anObject) after: otherLink.
^anObject! !

 !TransparentLinkedList methodsFor: 'adding' stamp: 'nice 7/28/2008 22:47'!
 add: anObject before: otherObject
Add anObject after otherObject in the list. Answer anObject.
If otherObject is not in the list, then raise an error.

| otherLink |
otherLink := self findLinkFor: otherObject ifAbsent: [^self error:
 'otherObject is not in this list'].
super add: (StackLink with: anObject) before: otherLink.
^anObject! !

 !TransparentLinkedList methodsFor: 'adding' stamp: 'nice 7/28/2008 21:54'!
 addFirst: anObject
Add anObject to the beginning of the receiver's list. Answer
 anObject.

super addFirst: (StackLink with: anObject).
^anObject! !

 !TransparentLinkedList methodsFor: 'adding' stamp: 'nice 7/28/2008 21:53'!
 addLast: anObject
Add anObject to the end of the receiver's list. Answer anObject.

super addLast: (StackLink with: anObject).
^anObject! !


 !TransparentLinkedList methodsFor: 'removing' stamp: 'nice 7/28/2008
 22:11'!
 remove: anObject ifAbsent: aBlock
Remove anObject from the receiver. If it is not there, answer the
 result of
evaluating aBlock.

| aLink |
aLink := self findLinkFor: anObject ifAbsent: [^aBlock value].
super remove: aLink ifAbsent: aBlock.
^anObject ! !

 !TransparentLinkedList methodsFor: 'removing' stamp: 'nice 7/28/2008
 21:55'!
 removeFirst
Remove the first element and answer it. If the receiver is empty,
 create
an error notification.

^super removeFirst element! !

 !TransparentLinkedList methodsFor: 'removing' stamp: 'nice 7/28/2008
 21:55'!
 removeLast
Remove the first element and answer it. If the receiver is empty,
 create
an error notification.

^super removeLast element! !


 !TransparentLinkedList methodsFor: 'enumerating' stamp: 'nice 7/28/2008
 22:12'!
 do: aBlock

self linkDo: [:aLink | aBlock value: aLink element]! !

 !TransparentLinkedList methodsFor: 'enumerating' stamp: 'nice 7/28/2008
 22:10'!
 findLinkFor: anObject ifAbsent: aBlock
self linkDo: [:aLink | aLink element = anObject ifTrue: [^aLink]].
^aBlock value! !

 !TransparentLinkedList methodsFor: 'enumerating' stamp: 'nice 7/28/2008
 22:15'!
 linkDo: aBlock
this could be ^super do: but I dislike sending super with a
 different message selector

| aLink

[Newbies] Linked list structure?

2008-07-27 Thread Marcin Tustin
Is there - either as standard, or freely downloadable - a datastructure that
is ordered, has constant-time appends of items, requires no particular
protocol of the items stored, and can be iterated over (without allocating a
new structure) starting with the first item added, proceeding to the next
item added? I.e. has the characteristics of a linked list structure in most
other datastructure libraries?
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Linked list structure?

2008-07-27 Thread Marcin Tustin
Technically, that would have amortised constant time adds, but yes, that's
good enough for me.

On Sun, Jul 27, 2008 at 10:57 PM, Michael van der Gulik
[EMAIL PROTECTED]wrote:



 On Mon, Jul 28, 2008 at 2:27 PM, Marcin Tustin [EMAIL PROTECTED] wrote:

 Is there - either as standard, or freely downloadable - a datastructure
 that is ordered, has constant-time appends of items, requires no particular
 protocol of the items stored, and can be iterated over (without allocating a
 new structure) starting with the first item added, proceeding to the next
 item added? I.e. has the characteristics of a linked list structure in most
 other datastructure libraries?



 I believe it's called an OrderedCollection, and it's in every Smalltalk
 image you'll find(*).

 I recommend reading through Chapter 9 of Squeak by Example (under
 Documentation on http://www.squeak.org/). It give a good explanation of
 Squeak collections and how to use them.

 Gulik.

 (*) Perhaps except for Craig Latta's 1337-byte image.

 --
 http://people.squeakfoundation.org/person/mikevdg
 http://gulik.pbwiki.com/

 ___
 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: Re[2]: [Newbies] Rouding Floats up to a number of decimals - Method Finder

2008-07-23 Thread Marcin Tustin
Why is it important to you to have a float? Once you've truncated it, you
have a rational number, by definition.
Are you sure you want to truncate the number, rather than performing the
truncation in the presentation layer?

On Wed, Jul 23, 2008 at 10:34 AM, cdrick [EMAIL PROTECTED] wrote:

 
  Float has a truncate and round off protocal with metods that truncate
  and round to integer.
 
  So it looks you have to do something like
 
  (aFloat * (10^desiredDecimals) + 0.5) truncated / (10^desiredDecimals)
 
  or without the + 0.5 for truncation.
 


 close to what I proposed earlier ;-)  Just need a conversion to Float
 as it returns a fraction.

 so no existing method... Isn't it something common ?
 ___
 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] Another extension proposal - subsets

2008-07-23 Thread Marcin Tustin
Googling smalltalk powerset turns this up:
http://www.foldr.org/~michaelw/log/2005/09/

On Wed, Jul 23, 2008 at 11:51 AM, cdrick [EMAIL PROTECTED] wrote:

 When we don't find method, we reinvent the wheel. Ok, so this is what
 happened with my quest on rounding float. So here is another example.
 I needed a method subsets ... to have all subsets of a Set...

 #(1 2 ) asSet subsets  - a Set(a Set(1 2) a Set(1) a Set(2) a Set()) 

 Is there already something ? I couldn't find so here is what I did ?
 probably hackish (because of the binary mask) so feel free to comment
 ;)

 Setsubsets
 | subsetsSize subsets workArray |
workArray := self asArray.
subsetsSize := 2 raisedTo: self size.
subsets := OrderedCollection new.
1 to: subsetsSize do: [:ea |
subsets add: ((workArray masquedBy: (ea printStringBase: 2))
 asSet)]. masque par une conversion binaire
^subsets asSet  could be an array of sets

 ArrayedCollectionmasquedBy: aBitString
 | result entry bitString |
entry := self reverse.
bitString := aBitString reverse.
result := OrderedCollection new.
1 to: (self size) do: [:ea |
 ((bitString  at: ea ifAbsent: []) = $1) ifTrue: [result
 add: (entry
 at: ea)]].
^result reverse

 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


Re: [Newbies] What is a weak reference

2008-07-15 Thread Marcin Tustin
One of the uses of weak references in other languages is to keep a
collection of all the instances of a class without preventing them being
garbage collected. Obviously, this is not necessary in squeak.

On 7/15/08, Herbert König [EMAIL PROTECTED] wrote:

 Hello cdrick,


 c All that sounds like don't use weak reference :)

  unless you know exactly what you are doing.


 --
 Cheers,


 Herbert


 ___
 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] Flushing Squeak Cache

2008-07-08 Thread Marcin Tustin
I encountered a similar problem a few days ago, and asked about it.
Discussion, but no particular answer was forthcoming, probably because I
included the work around, which is:

ClassName compileAll


On 7/8/08, Dirk Leas [EMAIL PROTECTED] wrote:

 I'm running latest Squeak on OS X. I in the beginning of Section 2 of the
 laser game walk through and I forgot to add the class method to
 GridDirection. I run the test cases including my new GridDirectionTestCase
 and it of course fails as it doesn't know what the symbol is. I go back and
 add it (browse it again after adding it just to make sure I added it), and I
 get the same error in the Test Runner.

 There have been several occasions where I add something (e.g. class,
 method, instance variable, etc.), go back to do some rafactoring, and expect
 the latest save to cascade through the VM so that my next test case runs the
 latest code -- often it doesn't. I've seen this before in other environments
 where the VM is cashing stuff and latest code isn't always getting run.

 TIA,
 D



 On Tue, Jul 8, 2008 at 5:34 PM, Matthew Fulmer [EMAIL PROTECTED] wrote:

 On Tue, Jul 08, 2008 at 05:21:01PM -0400, Dirk Leas wrote:
 I'm enjoying my stroll through the laser game walk through, but find
 the
 VM caching scheme getting in the way with my test driven development
 (you
 know, hack w/t regard, fix typos, test again ;-)). How do I flush it?

 I have no idea what you are talking about. I don't know of any
 VM caching scheme. Could you describe what problem you
 encountered, and what you were doing?

 --
 Matthew Fulmer -- http://mtfulmer.wordpress.com/
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners




 --

 Dirk Leas
 South Orange, NJ

 Ergonomic Tip of the Day: Hug your spouse and kids!
 ___
 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] Totally dumbfounded!!

2008-07-04 Thread Marcin Tustin
Stephen,

Although in theory it is possible to look anything up in the source code,
don't be discouraged that you cannot do this yet.

Marcin

On 7/4/08, Stephen Ng [EMAIL PROTECTED] wrote:

 Hi everyone,

 First off, I am really new to smalltalk. I have tons of experience with
 languages like C but have never made the move to OO type languages.

 Secondly, I've been reading up as much as I can on OO concepts and perhaps
 I can say that I feel comfortable with smalltalk syntax. My question is how
 does one start learning about the MVC or Morphic interfaces in order to use
 smalltalk in writing programs that make use of lots of windows with text
 fields etc like in traditional business systems? I cannot seem to find
 complete info on these topics. Many tutorials just spend lots of time
 painting pretty lines and patterns and fall short of showing someone like me
 how best to use the MVC, Graphics-* or Morphic-* class categories and their
 classes. I understand Morphic is the new wave as far as Squeak is concerned
 and I would be just as happy to use it. However, all the literature on the
 web is really disparate and does not approach the subject in a holistic way.
 I've even tried looking at the classes themselves in the Browser but the
 whole thing just gets very confusing.

 I'd appreciate it if anyone can provide some pointers, direction,
 literature (up to date with Squeak) etc.

 Thanks in  advance.

 Stephen
 ___
 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


[Newbies] What's the deal with the changes file/versions button?

2008-07-03 Thread Marcin Tustin
I see a lot of stuff telling me that the changes file logs accepted edits,
and that this is useful if the dog rolls over the power cord. Having lost
power on the computer today, I can't find a way to access any unsaved, but
accepted changes. Is there a setting for this? Is there some other way to
get accepted edits to code saved?
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] What's the deal with the changes file/versions button?

2008-07-03 Thread Marcin Tustin
OK, thanks - problem solved!

For the record, I discovered that the world menu (left click on seaside
desktop) has a changes item which leads to a bunch of stuff including
recently logged changes. From there, you get a menu asking how far back to
browse, and from there one can recover lost edits.

On 7/3/08, Bert Freudenberg [EMAIL PROTECTED] wrote:


 Am 03.07.2008 um 18:39 schrieb Marcin Tustin:

  I see a lot of stuff telling me that the changes file logs accepted edits,
 and that this is useful if the dog rolls over the power cord. Having lost
 power on the computer today, I can't find a way to access any unsaved, but
 accepted changes. Is there a setting for this? Is there some other way to
 get accepted edits to code saved?


 See the FAQ's Trouble shooting section, in particular What do I do when
 Squeak crashes or freezes?

 http://wiki.squeak.org/squeak/471


 - Bert -


 ___
 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


[Newbies] Changing superclass doesn't work automatically

2008-07-02 Thread Marcin Tustin
I recently came across a piece of behaviour which is (sort of)
understandable, but I wonder if it is how it is supposed to happen or not. I
was running through the potsdam seaside tutorial, and I change the
superclass of one of the objects from Object to WAComponent, and accepted
the change. All the browser tools treated the class as if its protocol
included the messages of WAComponent, but running code that sent WAComponent
messages signaled MessageNotUnderstood.

I fixed the problem by running Compiler recompileAllFrom:
'StMenuComponent'.I cannot reproduce the behaviour in a workspace with
subclasses of
Object/String.

Any ideas on why this happened, but is not reproduceable in the workspace,
and is it supposed to work like that?
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Design best practice : put state-independent methods on class side?

2008-03-25 Thread Marcin Tustin
What's wrong with keeping them instance-side?

On Tue, Mar 25, 2008 at 5:41 PM, itsme213 [EMAIL PROTECTED] wrote:

 I have some methods that currently refer to iVars, called from other
 methods
 of the same class. I need similar functionality in other classes, not
 related by inheritance, and want to keep it DRY.

 If I move the iVar references into explicit method args they can be easily
 re-located and shared.

 Is it then good or bad practice to take a such collection of related
 state-independent methods (they don't depend on any iVar) and put them on
 the class-side of some suitable class?

 My options and concerns:
 - I could move them up the hierarchy on the instance side but sometimes
 hit
 single inheritance limits
 - I could use traits for these but am unclear about the future of traits
 in
 Squeak
 - I can put on the class side and call easily from instance-side methods,
 but is this OK practice?

 Thanks,

 Sophie



 ___
 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


[Newbies] Loading Rome SVG package

2008-02-18 Thread Marcin Tustin
I can load the following packages out of the squeaksource repository:
Rome-Balloon
Rome-Base
Rome-PluginCanvas
Rome-SVG
Rome-Strike
Rome-Tests
Rome-Reference
Rome-BalloonCanvas

The rest give me errors about lacking other classes, which I reproduce
below. Are the packages that load enough to be useful, or am I going to be
stuffed when playing around with Rome? If so, where should I get the
dependencies? Also, there's a lack of class comments. Is there documentation
elsewhere? Is Rome even ready to be used at all?

Rome-Demo also gives me a syntax error: fontFor: aCanvas family: aFamily
style: aStyle has a full stop after the comment. After fixing this it gives
me an error because RomeFreetypeCanvas is not recognised.

Thanks all!

Rome-Tweak depends on:
This package depends on the following classes:
  CMatrixTransform
  CBitmapFill
  CTransformCanvas
  CDisplayTransform
  CCostumeFill
  CGraphicsFill
  CNoFill
  CIdentityTransform
  CProjectBuilder
  CSolidFill
  CGradientFill
  COffsetTransform


Rome-FontManager:
This package depends on the following classes:
  FreetypeFontFace
  FreetypeFont

Rome-Plugin:
This package depends on the following classes:
  SmartSyntaxInterpreterPlugin
  CCodeGenerator
  TSendNode
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] How to empty a collection?

2008-02-18 Thread Marcin Tustin
Isn't Cedrick's aida solution going to be significantly faster?

On Feb 19, 2008 1:02 AM, Ron Teitelbaum [EMAIL PROTECTED] wrote:

 Hi Sophie,

 aCollection copy do: [:anElement |
aCollection remove: anElement
 ].

 Why copy?  If you start removing items from the collection, increasing the
 index will cause you to skip elements.

 Ron

  -Original Message-
  From: itsme213
 
  I want to clear its contents (size goes back to zero), and can't seem to
  find something like #clear or #empty. Cannot use a new collection as
 there
  are shared references to it.
 
  Thanks - Sophie


 ___
 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] Re: [BUG] Inconsistent float soustraction

2008-02-17 Thread Marcin Tustin
I don't know which university you went to, but I certainly never observed
any serious attempt to enforce such a rule at university. That said, it's a
good one for all of us to learn if we don't apply it already.

On Feb 17, 2008 8:56 PM, [EMAIL PROTECTED] wrote:

 Cedric,

 Part of the issue is that different architectures will have different
 values for machine epsilon (1e-09 in your post).  Machine epsilon is
 defined to be the largest float such that

 0.0 + epsilon = 0.0

 Its value varies according to your machine though - typically a machine
 with a much larger machine word size in its floating point processor will
 have a much smaller machine epsilon. (The following is an example of a
 Simple Lie, for an introduction to the Complicated Truth I suggest you get
 hold of a book on Numerical Computation, which is an important study in
 Computer Science).

 Things are complicated further in that in any radix based number system
 there are very simple numbers that cannot be written exactly.  In the
 decimal number system any fraction with a denominator relatively prime to
 the radix tends to be an infinitely repeating fraction. 1/3 or 3/7 are
 examples.

 Computers use binary numbers inside. 1/10 is not expressible as a
 nonrecurring binary fraction, nor is 1/3, 3/10, 2/5 or 1/20.

 Squeak does a good job of trying to promote numbers to ScaledDecimals, but
 they are much more expensive to calculate than IEEE floats or Integers.

 If we repeat your examples using Fractions we get

 1 - (2/10) - (5/100) - ( 3/10) - (1/10) -(1/10) = (1/4) true

 because Fractions are exact - in fact the definition of equality for
 fractions is defined to be

 ( a/b ) = ( c/d ) if and only if ( a * d ) = (b * c)

 which only uses Integer and BigNum arithmetic and allows arbitrary
 precision (unless the numbers are so big you run out of memory).

 Your idea of redefining equality for floats is a very bad idea because (1)
 it assumes all hardware has the same value for machine epsilon and (2)
 will break 50 years worth of programs that do numerical computation.

 The simplest rule is any attempt to test floats (or doubles, or IEEE
 decwords) for equality is a bug.  If there's a decimal point in your
 calculations (or if there could be) then don't test for equality.  This is
 taught to computing students at University in the first few weeks.  Any
 work done by a Uni student who breaks this rule gets marked down very
 severely!

 I commend you on discovering this on your own by the way - it shows an
 inquiring mind.  It's not everyone who hits one of the key issues in
 Computer Science by themselves, and then thinks about it.

 Yours,

 John.

   Hi,
  
   I noticed in my image (damien last beta so 3.10 - windows XP and
   Vista) that I have a strange bug when soustracting floats
   successively. Here is how I reproduce it in a workspace:
  
   1 - 0.2 -0.05 -0.3 = 0.45 true
   1 - 0.2 -0.05 -0.3 -0.1= 0.35  true
   1 - 0.2 -0.05 -0.3 -0.1 - 0.10= 0.25  *false*
   1 - 0.2 -0.05 -0.3 -0.1 - 0.10= 0.24995   true
  
   or again:
   1 - 0.1 = 0.9  true
   1 - 0.1 - 0.1 = 0.8 true
   1 - 0.1 - 0.1 - 0.1 = 0.7 false
  
  
   Can somebody explain that or is it a bug ? I don't know yet if it's
   specific to my image, so does other have the same behavior?
   I can force the rounding of the result but find it strange.
  
   Cédrick
 
  2008/2/17, danil osipchuk [EMAIL PROTECTED]:
  This is not even squeak specific. Decimal floats not always can be
  represented precisely in binary form:
 
  http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
 
 
 
  Hi Cédrick,
 
  if you need to operate with exact precision just don't trust
  floats. Use ScaledDecimals instead. In Squeak ScaledDecimals are
  implemented with the fraction so it's matematically stronger
  than floats. Use floats at presentation or user interface time
  and evade them at domain model.
 
  cheers,
 
  Sebastian Sastre
 
  uhm ok, good to know.
  Actually, it was just a test that failed so I was surprised.
 
  I still find the result odd.
 
  Seeing ScaledDecimaltestConvertFromFloat, I'm wandering if it would
  be better to have Float=   considering egality if the difference is
  less than 1.0e-9.
 
  primitive: 47
  aNumber isNumber ifFalse: [^ false].
  ^ (aNumber asFloat - self) abs1.0e-9
 
  I would prefer having = working as I expect, even if it would be wrong
  for smaller values than 1.0e-9. For strict egality, == can be used.
 
  Is it possible to disable a primitive call like here (it's optimized no
 ?)
  ?
 
  Anyway, thanks for your answers.
 
  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


[Newbies] Squeaksource and dependencies (and Rome)

2008-01-31 Thread Marcin Tustin
I'm trying to load the Rome package from Squeaksource, and I keep getting
error messages about needing certain other classes. Is there an easy way to
find out which packages contain those classes?
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] block in recursion, Any cure for that kind of situation?

2008-01-22 Thread Marcin Tustin
You could add an extra parameter that is another block. Use that parameter
as the value of carre in the block. something like:

f := [:a :ff | a ifTrue: [ff (a not) ff] ]
ff: = [:a :ff | a ifTrue: [ff (a not) ff] ]

On Jan 22, 2008 9:10 PM, Hilaire Fernandes [EMAIL PROTECTED] wrote:

 I got an error Attempt to evaluate a block that is already being
 evaluated, when I call in recursion a block like

 carre := [:s1 :s2 :s3 :s4 :n |
n 0 ifTrue:
[carre valueWithArguments:  {(segment value: s1 value: s2).
 (segment value: s2 value: s3).
 (segment value: s3 value: s4).
 (segment value: s1 value: s4).
 n-1}]]

 Hilaire

 ___
 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] block in recursion, Any cure for that kind of situation?

2008-01-22 Thread Marcin Tustin
For the avoidance of confusion, here is a version with non-guessed syntax:

f := [:a :ff | a ifTrue: [{a . (ff value: (a not) value: ff)}] ifFalse: a].
g := [:a :ff | a ifTrue: [{a . (ff value: (a not) value: ff)}] ifFalse: a].
f value: true value: g.

On Jan 22, 2008 9:35 PM, Marcin Tustin [EMAIL PROTECTED] wrote:

 You could add an extra parameter that is another block. Use that parameter
 as the value of carre in the block. something like:

 f := [:a :ff | a ifTrue: [ff (a not) ff] ]
 ff: = [:a :ff | a ifTrue: [ff (a not) ff] ]


 On Jan 22, 2008 9:10 PM, Hilaire Fernandes [EMAIL PROTECTED] wrote:

  I got an error Attempt to evaluate a block that is already being
  evaluated, when I call in recursion a block like
 
  carre := [:s1 :s2 :s3 :s4 :n |
 n 0 ifTrue:
 [carre valueWithArguments:  {(segment value: s1 value:
  s2).
  (segment value: s2 value: s3).
  (segment value: s3 value: s4).
  (segment value: s1 value: s4).
  n-1}]]
 
  Hilaire
 
  ___
  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] block in recursion, Any cure for that kind of situation?

2008-01-22 Thread Marcin Tustin
I'm an idiot. That doesn't work either. Why not?

On Jan 22, 2008 10:12 PM, Marcin Tustin [EMAIL PROTECTED] wrote:

 For the avoidance of confusion, here is a version with non-guessed syntax:

 f := [:a :ff | a ifTrue: [{a . (ff value: (a not) value: ff)}] ifFalse:
 a].
 g := [:a :ff | a ifTrue: [{a . (ff value: (a not) value: ff)}] ifFalse:
 a].
 f value: true value: g.


 On Jan 22, 2008 9:35 PM, Marcin Tustin [EMAIL PROTECTED] wrote:

  You could add an extra parameter that is another block. Use that
  parameter as the value of carre in the block. something like:
 
  f := [:a :ff | a ifTrue: [ff (a not) ff] ]
  ff: = [:a :ff | a ifTrue: [ff (a not) ff] ]
 
 
  On Jan 22, 2008 9:10 PM, Hilaire Fernandes [EMAIL PROTECTED] wrote:
 
   I got an error Attempt to evaluate a block that is already being
   evaluated, when I call in recursion a block like
  
   carre := [:s1 :s2 :s3 :s4 :n |
  n 0 ifTrue:
  [carre valueWithArguments:  {(segment value: s1 value:
   s2).
   (segment value: s2 value: s3).
   (segment value: s3 value: s4).
   (segment value: s1 value: s4).
   n-1}]]
  
   Hilaire
  
   ___
   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] block in recursion, Any cure for that kind of situation?

2008-01-22 Thread Marcin Tustin
So am I right in thinking that if I get newCompiler, blocks will work as I
would expect them to (like lambdas)?

If so, how do I get the most recent version? I remember there being
something that has superceded squeakmap, but I can't seem to find it.

On Jan 22, 2008 11:42 PM, Ben Goetter [EMAIL PROTECTED] wrote:

 This is a maintenance nightmare waiting to happen.  Use a proper method
 call,

 Squeak Smalltalk blocks are just similar enough to Scheme lambdas that I
 still fall into this trap, too.

 (letrec ((carre (lambda (s1 s2 s3 s4 n)
 (if ( n 0)
  (carre (segment s1 s2)
 (segment s2 s3)
 (segment s3 s4)
 (segment s1 s4)
 (- n 1))
  'oops-must-remember-this-is-Squeak-not-Scheme)

 Ben
 ___
 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] block in recursion, Any cure for that kind of situation?

2008-01-22 Thread Marcin Tustin
I figured it out - I meant monticello + squeaksource.

Having loaded newcompiler, ast, blockchecker, and newcompilerloader, it
doesn't seem to have made a difference.

On Jan 23, 2008 12:00 AM, Marcin Tustin [EMAIL PROTECTED] wrote:

 So am I right in thinking that if I get newCompiler, blocks will work as I
 would expect them to (like lambdas)?

 If so, how do I get the most recent version? I remember there being
 something that has superceded squeakmap, but I can't seem to find it.


 On Jan 22, 2008 11:42 PM, Ben Goetter [EMAIL PROTECTED] wrote:

  This is a maintenance nightmare waiting to happen.  Use a proper method
  call,
 
  Squeak Smalltalk blocks are just similar enough to Scheme lambdas that I
  still fall into this trap, too.
 
  (letrec ((carre (lambda (s1 s2 s3 s4 n)
  (if ( n 0)
   (carre (segment s1 s2)
  (segment s2 s3)
  (segment s3 s4)
  (segment s1 s4)
  (- n 1))
   'oops-must-remember-this-is-Squeak-not-Scheme)
 
  Ben
  ___
  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] squeak twexter?

2008-01-16 Thread Marcin Tustin
OK, take a deep breath. You're likely to need the help of someone who knows
how to programme well, and who isn't going to be dogmatic about your choices
of technology, and who can help you break this project down.

Secondly, you need to learn to programme before you can really write a
programme. Then, to write it well, you're like to need to re-write it
(unless it's quite simple and you're a very good software developer).

So, I would recommend this as a place to start with squeak:
http://www.google.com/url?sa=tct=rescd=2url=http%3A%2F%2Fwww.swa.hpi.uni-potsdam.de%2Fseaside%2Ftutorialei=dDeOR9GEBpfuwwGxntyCBgusg=AFQjCNFKoc3tTMb2Wm0BeajcrXwKeaskMwsig2=L8JYcA_IZLUr4OpTw_RU7Q

After that, try doing something similar, or relevant to twext, in php, with
a php tutorial.

Good luck!

On Jan 16, 2008 4:45 PM, duke crawford [EMAIL PROTECTED] wrote:

 hi i'm a non programmer who wants to learn to program
 because i wanna make http://twext.cc/go/twexter work

 php has lots of developers and we have some existing
 php code to start with, but maybe squeak is better?
 * squeak sounds simpler
 * maybe easier to learn
 * maybe easier to work with
 * http://wiki.laptop.org/go/WiXi#scratch

 i got here because i saw an article i liked:

 http://onsmalltalk.com/programming/smalltalk/simple-image-based-persistence-in-squeak/
 which may be a way to avoid mysql
 mysql looks really really hard to me..

 my dream is distribute/find/modify/share twext data
 in some kinda flexible machine readable and
 very *human* readable flat file system:
 http://twext.cc/go/18#.twx

 first things first, my basic question is this:
 would squeak be a good way to get text twext?
 DEMO: http://twext.cc/twexter
 CODE: http://twexter.svn.sourceforge.net/viewvc/twexter/twexter-basic/

 if yes, is there anyone i can pay to help me
 get twext with squeak?  thanks!!
 ___
 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] Defining a class at runtime

2007-07-20 Thread Marcin Tustin

On 7/20/07, Bert Freudenberg [EMAIL PROTECTED] wrote:


On Jul 20, 2007, at 8:52 , Louis Moon wrote:

 Hello. I've been playing around with Squeak the last couple of
 days, and I've found it pretty easy to use so far. However, I can't
 figure out how to do this (I'm trying mostly out of curiousity). I
 suspect it had something to do with the ClassBuilder class, but I
 can't figure out its usage. How's it done? Thanks for any help.

In Squeak there is no runtime. Just send the same message you use
to create a class in a browser.



What is that message? We're all holding our breath.

(If you're not going to say that, I'll point out that it is possible to
examine code in the browser to see how it does it.)

...and yes, of course, there is a runtime.
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Defining a class at runtime

2007-07-20 Thread Marcin Tustin

Just because code definition happens as part of the runtime of the whole
system does not mean that any piece of code does not have a code definition
time during which one could arrange to, for example, do macro substitution.

On 7/20/07, Bert Freudenberg [EMAIL PROTECTED] wrote:


On Jul 20, 2007, at 11:57 , Marcin Tustin wrote:

 On 7/20/07, Bert Freudenberg [EMAIL PROTECTED] wrote:
 On Jul 20, 2007, at 11:31 , Marcin Tustin wrote:

 
 
  On 7/20/07, Bert Freudenberg [EMAIL PROTECTED] wrote: On Jul
  20, 2007, at 8:52 , Louis Moon wrote:

  ...and yes, of course, there is a runtime.

 Well, you could say there is only runtime. Which makes the term
 useless, as it implies some sort of opposite.

 Then how would you refer to runtime? In any case, we can oppose it
 to code-definition time. Nothing exciting may happen then, but it's
 worth being able to talk about it.

There is no technical distinction. All you do when defining code is
creating an instance and adding it to a dictionary in some object.
That's no different from other activities you do at runtime.

The instance might be an instance of a metaclass and the dictionary
might be held in a global variable called Smalltalk. Or the instance
could happen to be a CompiledMethod instance, and the dictionary
would be the method dictionary of a class object. So what?

Sending messages, creating instances, storing them in fields of other
objects, wouldn't you call that runtime if you insist on that term?

- Bert -


___
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] Better editor components?

2007-06-13 Thread Marcin Tustin

Thanks! This was the one thing that actually prompted me to look for
something better, but I expect I'll like having SVI provide emacs keys as
well.

On 6/13/07, Scott Wallace [EMAIL PROTECTED] wrote:


On Jun 12, 2007, at 6:40 PM, Stuart Herring wrote:

 About the only issue I've found is that tab won't indent selected
 lines - it just replaces them with a tab.


Correct -- this is the same as in *any* wysiwig editor, because tab
is an actual text character that resides in the body of text, rather
than a meta-directive to an editor.

However, hitting alt-shift-R indents all selected lines, i.e. shifts
them right by one tab-stop, which I think is what you are looking for.

Similarly, alt-shift-L will shift all selected lines one tab-stop to
the *left*.


Cheers,

  -- Scott


___
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] Fishing for a Masters Thesis Topic

2007-06-13 Thread Marcin Tustin

Consider something about how continuation-based frameworks/smalltalk are
more accessible to end users/allow them good scripting/customising times? Of
course, it would be difficult to find test subjects for this, and I don't
know how many credible office apps there are implemented in squeak. Of
course, that may be going over old ground.

Actually, the phrase that springs to mind is ad hoc collaboration - do
something about managing and supporting groups or individuals who need to
develop and document processes that they create and change on the fly.
Journal-based user interfaces? Of course, I suspect that you'll want to keep
your coding to a minimum, so you can focus on measuring results.

On 6/13/07, Robert Stehwien [EMAIL PROTECTED] wrote:


I've been primarily a Windows C++ developer for 12 years with a little
Java, Perl, Python, and lately Ruby along the way.  I've never looked
at line of Smalltalk until recently.  But that all changed when I
decided to get a Masters in CS and since a PhD isn't out of the
question write a thesis.

When asked by a co-worker what my thesis topic would be, I said maybe
something with peer-to-peer, gaming, collaborative environments, 3D,
education, visual programming, interaction design, or languages (big
list I know but somewhat ordered).  I started digging around and
noticed a pattern... Smalltalk, Squeak, Croquet, and Seaside kept
coming up (although it took a little while to notice the mouse icon
and 3d bunny.

So I've ordered the book Object Land, downloaded all the free books
and Squeak (ordered the DVD too), and joined the list.  But I'm still
having trouble narrowing down a thesis topic to present to my advisor
(for adjustment I'm sure).

Anyone have any suggestions for a thesis topic?  Maybe there is some
part of Squeak that the community would like
documented/researched/implemented.  P2P gaming/collaboration using
Croquet sound interesting, but I'm pretty open for suggestions.

Thanks,
Robert

PS: As a working C++ developer it will take a while for me to finish
the thesis and my masters.
___
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