RE: [Newbies] Re: new and initialize

2016-05-10 Thread Ron Teitelbaum
From: Joseph Alotta Sent: Tuesday, May 10, 2016 3:38 PM > On May 10, 2016, at 12:45 PM, Ron Teitelbaum [via Smalltalk] <[hidden email]> > wrote: > > Hi Joe, > > Excellent question. Try this. > > Object new. > > Highlight it and do debug it. Click "Into" to go into the #ne

Re: [Newbies] Re: new and initialize

2016-05-10 Thread Ben Coman
On Wed, May 11, 2016 at 3:37 AM, Joseph Alotta wrote: > >> On May 10, 2016, at 12:45 PM, Ron Teitelbaum [via Smalltalk] <[hidden >> email]> wrote: >> >> Hi Joe, >> >> Excellent question. Try this. >> >> Object new. >> >> Highlight it and do debug it. Click "Into" to go into the #new method. >>

[Newbies] Re: next or break in a loop

2016-05-10 Thread Joseph Alotta
> On May 10, 2016, at 12:03 PM, Louis LaBrunda [via Smalltalk] > wrote: > > Joe, > > At each test for the type of data you can also test to see if you found type, > something like > this: > > stream := ReadStream on: myCollection. > [stream atEnd] whileFalse: [:item | | n

[Newbies] Re: new and initialize

2016-05-10 Thread Joseph Alotta
> On May 10, 2016, at 12:45 PM, Ron Teitelbaum [via Smalltalk] > wrote: > > Hi Joe, > > Excellent question. Try this. > > Object new. > > Highlight it and do debug it. Click "Into" to go into the #new method. > > Notice the implementation of #new. > > You should be able to see

RE: [Newbies] new and initialize

2016-05-10 Thread Ron Teitelbaum
Hi Joe, Excellent question. Try this. Object new. Highlight it and do debug it. Click "Into" to go into the #new method. Notice the implementation of #new. You should be able to see there that #initialize is called automatically. Also for extra points notice what class new is impleme

[Newbies] new and initialize

2016-05-10 Thread Joseph Alotta
Greetings, I have an instance method called ‘initialize’ that defines instance variables. I want it to run whenever a new instance is created. How do I accomplish that? I tried to add a class method ‘new’ that contained ^(super new) initialize. But it warned me about adding the message say

[Newbies] next or break in a loop

2016-05-10 Thread Louis LaBrunda
Joe, At each test for the type of data you can also test to see if you found type, something like this: stream := ReadStream on: myCollection. [stream atEnd] whileFalse: [:item | | notFound | item := stream next. notFound := true. (

[Newbies] Re: next or break in a loop

2016-05-10 Thread Joseph Alotta
Lou, I was trying to use the ReadStream, but the issue is to get execution to go back to the top. If I send the upToEnd message, it still executes from the same line and goes through the rest of the tests. Sincerely, Joe. > On May 9, 2016, at 3:56 PM, Louis LaBrunda [via Smalltalk] > wr