Re: Beginners Digest, Vol 42, Issue 11

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Beginners Digest, Vol 42, Issue 11

Mark Dymek
a great introduction to squeak is squeak by example. And best of all
it's free!!!

Sent from my iPod

On Oct 30, 2009, at 12:25 PM, [hidden email]
  wrote:

> Send Beginners mailing list submissions to
>    [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>    http://lists.squeakfoundation.org/mailman/listinfo/beginners
> or, via email, send a message with subject or body 'help' to
>    [hidden email]
>
> You can reach the person managing the list at
>    [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
>
>
> Today's Topics:
>
>   1. hello (Alan Turing)
>   2. Re: hello (David Mitchell)
>   3. Drawing a line on a morph (Christine Wolfe)
>   4. Re: Closure support (Andy Burnett)
>   5. Re: Closure support (Randal L. Schwartz)
>   6. Re: hello (Alex Schenkman)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 30 Oct 2009 15:27:47 +0100
> From: Alan Turing <[hidden email]>
> Subject: [Newbies] hello
> To: [hidden email]
> Message-ID:
>    <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> I am new in smalltalk and squeak.
> In this language what is the right way to learn smalltalk/squeak? I am
> reading a ebook of Ducasse "learn programming with robots" and it
> seems good for begin. Anyway, after this book I would like make
> something for manage networks and database; what resource may I use?
>
> thanks.
>
>
> max
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 30 Oct 2009 10:31:52 -0500
> From: David Mitchell <[hidden email]>
> Subject: Re: [Newbies] hello
> To: "A friendly place to get answers to even the most basic questions
>    about    Squeak." <[hidden email]>
> Message-ID:
>    <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Max,
>
> Steph's book is a nice way to learn programming. I'm actually using
> his bots
> environment as part of a presentation I'm doing this coming Saturday
> at the
> Iowa Code Camp in Des Moines.
>
> Steph has a great list of free Smalltalk books on his site. On that
> is a
> little dated but is an excellent read is known as the NuBlue book by
> Mark
> Guzdial:
>
> http://www.amazon.com/Squeak-Open-Personal-Computing-Multimedia/dp/0130280917
>
> You can actually review a draft of the chapters of that book from
> Steph's
> site. There is one chapter in particular by Bijian Parsia, Lex Spoon
> (of
> Programming Scala fame), and Bolot Kerimbaev:
>
> http://coweb.cc.gatech.edu/squeakbook/uploads/parsia.pdf
>
> Good luck
>
> --David
> http://www.withaguide.com
>
>
>
> On Fri, Oct 30, 2009 at 9:27 AM, Alan Turing <[hidden email]>
> wrote:
>
>> Hi,
>>
>> I am new in smalltalk and squeak.
>> In this language what is the right way to learn smalltalk/squeak? I
>> am
>> reading a ebook of Ducasse "learn programming with robots" and it
>> seems good for begin. Anyway, after this book I would like make
>> something for manage networks and database; what resource may I use?
>>
>> thanks.
>>
>>
>> max
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/e2af5f3e/attachment-0001.htm
>
> ------------------------------
>
> Message: 3
> Date: Fri, 30 Oct 2009 11:52:26 -0400
> From: "Christine Wolfe" <[hidden email]>
> Subject: [Newbies] Drawing a line on a morph
> To: <[hidden email]>
> Message-ID: <003c01ca5978$fa97cb40$efc761c0$@net>
> Content-Type: text/plain; charset="us-ascii"
>
> If anyone has followed the dice example in Chapter 11 of Squeak By
> Example
> you will recognize that I'm trying to build a variation of the
> dice.  The
> difference is that I am trying to draw figures on the faces instead
> of dots.
>
>
>
> What I am trying to do is have a group (array, set, collection?) of
> "faces"
> on a rectangle - sort of like a child's building block with an image
> on each
> of the faces. I want 1 face to be blank, one to have a line, one to
> have a
> diamond, and one to have a rectangle. In the dice example, they draw
> dots on
> the faces but I think I can use the same logic to draw lines on the
> faces.
>
>
>
> I've pasted what I tried to the end of this post but I'm open to
> other ways
> to do it.  I can't even get a simple line to draw on the face of the
> rectangle.  You can see that I tried to have the "face" methods send
> a pair
> of points that define the ends of the line and have drawLineOn draw
> a line
> between the points.  Any help or advice will be greatly appreciated.
>
>
>
> In the dice example they use:
>
>
>
> BorderedMorph subclass: #DieMorph
>
>                instanceVariableNames: 'faces dieValue isStopped'
>
>                classVariableNames: ''
>
>                poolDictionaries: ''
>
>                category: 'SBEexamples'
>
>
>
> and
>
>
>
> drawOn: aCanvas
>
> super drawOn: aCanvas.
>
> (self perform: ('face', dieValue asString) asSymbol)
>
> do: [:aPoint | self drawDotOn: aCanvas at: aPoint]
>
>
>
> and
>
>
>
> drawDotOn: aCanvas at: aPoint
>
> aCanvas
>
> fillOval: (Rectangle
>
> center: self position + (self extent * aPoint)
>
> extent: self extent / 6)
>
> color: Color black.
>
>
>
> and
>
>
>
> face1
>
> ^{0.5@0.5}
>
>
>
> And
>
>
>
> face2
>
> ^{0.25@0.25 . 0.75@0.75}
>
>
>
> I tried:
>
>
>
> BorderedMorph subclass: #MyMorph
>
>                instanceVariableNames: 'faces dieValue isStopped'
>
>                classVariableNames: ''
>
>                poolDictionaries: ''
>
>                category: 'SBEexamples'
>
>
>
> and
>
>
>
> drawOn: aCanvas
>
> super drawOn: aCanvas.
>
> (self perform: ('face', dieValue asString) asSymbol)
>
> do: [{:aPoint, anotherPoint} | self drawLineOn: aCanvas from: aPoint
> to:
> anotherPoint]
>
>
>
> and
>
>
>
> drawLineOn: aCanvas from: aPoint to anotherPoint
>
> aCanvas
>
> line: aPoint to: anotherPoint width: 2 color: Color black.
>
>
>
> and
>
>
>
> face1
>
> ^{{2@2, 2@10}, {2@2, 10@2}, {10@10, 2@10}, {10@10, 10@2}}
>
>
>
> And
>
>
>
> face2
>
> ^{{5@5, 5@7}, {5@2, 7@2}, {7@7, 5@7}, {7@7, 7@5}}
>
>
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/3251c477/attachment-0001.htm
>
> ------------------------------
>
> Message: 4
> Date: Fri, 30 Oct 2009 11:59:16 -0400
> From: Andy Burnett <[hidden email]>
> Subject: Re: [Newbies] Closure support
> To: [hidden email]
> Message-ID:
>    <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Randal said...
>
> <<With classic smalltalk 80 and Squeak:
>
> a := (1 to: 10) do: [:n | [n]].
> b := a collect: [:each | each value].
> b will have something like #(10 10 10 10 ...).
>
> The problem is that the :n in each block ([n]) is shared as one
> variable.
> In a true closure, which modern Squeak and Pharo provide, we get the
> proper
> #(1 2 3 4 ... 10).  That's because each apperance of "n" is "closed"
> with
> respect to the newly created block.>>
>
> Thanks for explaining the difference between blocks and closures. I
> think I
> new understand that.  And, your example raised a new question for me.
>
> What does the inner 'block' in [:n | [n]] actually do?
>
> Out of curiosity I tried changing it to [:n | [n*10]], expecting the
> numbers
> to be ten times bigger, but they were stil 1, 2, 3...  I also tried
> removing
> the whole block, and b still evaluated to the same values.
>
> Cheers
> Andy
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/cf1b528c/attachment-0001.htm
>
> ------------------------------
>
> Message: 5
> Date: Fri, 30 Oct 2009 09:10:46 -0700
> From: [hidden email] (Randal L. Schwartz)
> Subject: Re: [Newbies] Closure support
> To: Andy Burnett <[hidden email]>
> Cc: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
>>>>>> "Andy" == Andy Burnett <[hidden email]> writes:
>
> Andy> Randal said...
> Andy> <<With classic smalltalk 80 and Squeak:
>
> Andy> a := (1 to: 10) do: [:n | [n]].
> Andy> b := a collect: [:each | each value].
> Andy> b will have something like #(10 10 10 10 ...).
>
> Argh.  That should have been collect: not do:
>
> Andy> Out of curiosity I tried changing it to [:n | [n*10]],
> expecting the numbers
> Andy> to be ten times bigger, but they were stil 1, 2, 3...  I also
> tried removing
> Andy> the whole block, and b still evaluated to the same values.
>
> Works better with collect. :)
>
> a := (1 to: 10) collect: [:n | [n * 10]].
> b := a collect: [:each | each value]
>
> b is now #(10 20 30 40 50 60 70 80 90 100) in a closure world.  In
> non-closure, it would have been 100, 100, 100...
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <[hidden email]> <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
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 30 Oct 2009 17:24:57 +0100
> From: Alex Schenkman <[hidden email]>
> Subject: Re: [Newbies] hello
> To: "A friendly place to get answers to even the most basic questions
>    about    Squeak." <[hidden email]>
> Message-ID:
>    <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Squeak by example <http://squeakbyexample.org/> or Pharo by
> example<http://pharobyexample.org/>,
> both by Ducasse, are great books.
>
>
> On Fri, Oct 30, 2009 at 15:27, Alan Turing <[hidden email]>
> wrote:
>
>> Hi,
>>
>> I am new in smalltalk and squeak.
>> In this language what is the right way to learn smalltalk/squeak? I
>> am
>> reading a ebook of Ducasse "learn programming with robots" and it
>> seems good for begin. Anyway, after this book I would like make
>> something for manage networks and database; what resource may I use?
>>
>> thanks.
>>
>>
>> max
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/4a64f0bb/attachment.htm
>
> ------------------------------
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
> End of Beginners Digest, Vol 42, Issue 11
> *****************************************
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Beginners Digest, Vol 42, Issue 11

Alan Turing
Than you very much for your suggests! :)



2009/10/30  <[hidden email]>:

> Send Beginners mailing list submissions to
>        [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.squeakfoundation.org/mailman/listinfo/beginners
> or, via email, send a message with subject or body 'help' to
>        [hidden email]
>
> You can reach the person managing the list at
>        [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
>
>
> Today's Topics:
>
>   1. hello (Alan Turing)
>   2. Re: hello (David Mitchell)
>   3. Drawing a line on a morph (Christine Wolfe)
>   4. Re: Closure support (Andy Burnett)
>   5. Re: Closure support (Randal L. Schwartz)
>   6. Re: hello (Alex Schenkman)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 30 Oct 2009 15:27:47 +0100
> From: Alan Turing <[hidden email]>
> Subject: [Newbies] hello
> To: [hidden email]
> Message-ID:
>        <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> I am new in smalltalk and squeak.
> In this language what is the right way to learn smalltalk/squeak? I am
> reading a ebook of Ducasse "learn programming with robots" and it
> seems good for begin. Anyway, after this book I would like make
> something for manage networks and database; what resource may I use?
>
> thanks.
>
>
> max
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 30 Oct 2009 10:31:52 -0500
> From: David Mitchell <[hidden email]>
> Subject: Re: [Newbies] hello
> To: "A friendly place to get answers to even the most basic questions
>        about   Squeak." <[hidden email]>
> Message-ID:
>        <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Max,
>
> Steph's book is a nice way to learn programming. I'm actually using his bots
> environment as part of a presentation I'm doing this coming Saturday at the
> Iowa Code Camp in Des Moines.
>
> Steph has a great list of free Smalltalk books on his site. On that is a
> little dated but is an excellent read is known as the NuBlue book by Mark
> Guzdial:
>
> http://www.amazon.com/Squeak-Open-Personal-Computing-Multimedia/dp/0130280917
>
> You can actually review a draft of the chapters of that book from Steph's
> site. There is one chapter in particular by Bijian Parsia, Lex Spoon (of
> Programming Scala fame), and Bolot Kerimbaev:
>
> http://coweb.cc.gatech.edu/squeakbook/uploads/parsia.pdf
>
> Good luck
>
> --David
> http://www.withaguide.com
>
>
>
> On Fri, Oct 30, 2009 at 9:27 AM, Alan Turing <[hidden email]> wrote:
>
>> Hi,
>>
>> I am new in smalltalk and squeak.
>> In this language what is the right way to learn smalltalk/squeak? I am
>> reading a ebook of Ducasse "learn programming with robots" and it
>> seems good for begin. Anyway, after this book I would like make
>> something for manage networks and database; what resource may I use?
>>
>> thanks.
>>
>>
>> max
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/e2af5f3e/attachment-0001.htm
>
> ------------------------------
>
> Message: 3
> Date: Fri, 30 Oct 2009 11:52:26 -0400
> From: "Christine Wolfe" <[hidden email]>
> Subject: [Newbies] Drawing a line on a morph
> To: <[hidden email]>
> Message-ID: <003c01ca5978$fa97cb40$efc761c0$@net>
> Content-Type: text/plain; charset="us-ascii"
>
> If anyone has followed the dice example in Chapter 11 of Squeak By Example
> you will recognize that I'm trying to build a variation of the dice.  The
> difference is that I am trying to draw figures on the faces instead of dots.
>
>
>
> What I am trying to do is have a group (array, set, collection?) of "faces"
> on a rectangle - sort of like a child's building block with an image on each
> of the faces. I want 1 face to be blank, one to have a line, one to have a
> diamond, and one to have a rectangle. In the dice example, they draw dots on
> the faces but I think I can use the same logic to draw lines on the faces.
>
>
>
> I've pasted what I tried to the end of this post but I'm open to other ways
> to do it.  I can't even get a simple line to draw on the face of the
> rectangle.  You can see that I tried to have the "face" methods send a pair
> of points that define the ends of the line and have drawLineOn draw a line
> between the points.  Any help or advice will be greatly appreciated.
>
>
>
> In the dice example they use:
>
>
>
> BorderedMorph subclass: #DieMorph
>
>                instanceVariableNames: 'faces dieValue isStopped'
>
>                classVariableNames: ''
>
>                poolDictionaries: ''
>
>                category: 'SBEexamples'
>
>
>
> and
>
>
>
> drawOn: aCanvas
>
> super drawOn: aCanvas.
>
> (self perform: ('face', dieValue asString) asSymbol)
>
> do: [:aPoint | self drawDotOn: aCanvas at: aPoint]
>
>
>
> and
>
>
>
> drawDotOn: aCanvas at: aPoint
>
> aCanvas
>
> fillOval: (Rectangle
>
> center: self position + (self extent * aPoint)
>
> extent: self extent / 6)
>
> color: Color black.
>
>
>
> and
>
>
>
> face1
>
> ^{0.5@0.5}
>
>
>
> And
>
>
>
> face2
>
> ^{0.25@0.25 . 0.75@0.75}
>
>
>
> I tried:
>
>
>
> BorderedMorph subclass: #MyMorph
>
>                instanceVariableNames: 'faces dieValue isStopped'
>
>                classVariableNames: ''
>
>                poolDictionaries: ''
>
>                category: 'SBEexamples'
>
>
>
> and
>
>
>
> drawOn: aCanvas
>
> super drawOn: aCanvas.
>
> (self perform: ('face', dieValue asString) asSymbol)
>
> do: [{:aPoint, anotherPoint} | self drawLineOn: aCanvas from: aPoint to:
> anotherPoint]
>
>
>
> and
>
>
>
> drawLineOn: aCanvas from: aPoint to anotherPoint
>
> aCanvas
>
> line: aPoint to: anotherPoint width: 2 color: Color black.
>
>
>
> and
>
>
>
> face1
>
> ^{{2@2, 2@10}, {2@2, 10@2}, {10@10, 2@10}, {10@10, 10@2}}
>
>
>
> And
>
>
>
> face2
>
> ^{{5@5, 5@7}, {5@2, 7@2}, {7@7, 5@7}, {7@7, 7@5}}
>
>
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/3251c477/attachment-0001.htm
>
> ------------------------------
>
> Message: 4
> Date: Fri, 30 Oct 2009 11:59:16 -0400
> From: Andy Burnett <[hidden email]>
> Subject: Re: [Newbies] Closure support
> To: [hidden email]
> Message-ID:
>        <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Randal said...
>
> <<With classic smalltalk 80 and Squeak:
>
> a := (1 to: 10) do: [:n | [n]].
> b := a collect: [:each | each value].
> b will have something like #(10 10 10 10 ...).
>
> The problem is that the :n in each block ([n]) is shared as one variable.
> In a true closure, which modern Squeak and Pharo provide, we get the proper
> #(1 2 3 4 ... 10).  That's because each apperance of "n" is "closed" with
> respect to the newly created block.>>
>
> Thanks for explaining the difference between blocks and closures. I think I
> new understand that.  And, your example raised a new question for me.
>
> What does the inner 'block' in [:n | [n]] actually do?
>
> Out of curiosity I tried changing it to [:n | [n*10]], expecting the numbers
> to be ten times bigger, but they were stil 1, 2, 3...  I also tried removing
> the whole block, and b still evaluated to the same values.
>
> Cheers
> Andy
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/cf1b528c/attachment-0001.htm
>
> ------------------------------
>
> Message: 5
> Date: Fri, 30 Oct 2009 09:10:46 -0700
> From: [hidden email] (Randal L. Schwartz)
> Subject: Re: [Newbies] Closure support
> To: Andy Burnett <[hidden email]>
> Cc: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
>>>>>> "Andy" == Andy Burnett <[hidden email]> writes:
>
> Andy> Randal said...
> Andy> <<With classic smalltalk 80 and Squeak:
>
> Andy> a := (1 to: 10) do: [:n | [n]].
> Andy> b := a collect: [:each | each value].
> Andy> b will have something like #(10 10 10 10 ...).
>
> Argh.  That should have been collect: not do:
>
> Andy> Out of curiosity I tried changing it to [:n | [n*10]], expecting the numbers
> Andy> to be ten times bigger, but they were stil 1, 2, 3...  I also tried removing
> Andy> the whole block, and b still evaluated to the same values.
>
> Works better with collect. :)
>
> a := (1 to: 10) collect: [:n | [n * 10]].
> b := a collect: [:each | each value]
>
> b is now #(10 20 30 40 50 60 70 80 90 100) in a closure world.  In
> non-closure, it would have been 100, 100, 100...
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <[hidden email]> <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
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 30 Oct 2009 17:24:57 +0100
> From: Alex Schenkman <[hidden email]>
> Subject: Re: [Newbies] hello
> To: "A friendly place to get answers to even the most basic questions
>        about   Squeak." <[hidden email]>
> Message-ID:
>        <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Squeak by example <http://squeakbyexample.org/> or Pharo by
> example<http://pharobyexample.org/>,
> both by Ducasse, are great books.
>
>
> On Fri, Oct 30, 2009 at 15:27, Alan Turing <[hidden email]> wrote:
>
>> Hi,
>>
>> I am new in smalltalk and squeak.
>> In this language what is the right way to learn smalltalk/squeak? I am
>> reading a ebook of Ducasse "learn programming with robots" and it
>> seems good for begin. Anyway, after this book I would like make
>> something for manage networks and database; what resource may I use?
>>
>> thanks.
>>
>>
>> max
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091030/4a64f0bb/attachment.htm
>
> ------------------------------
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
> End of Beginners Digest, Vol 42, Issue 11
> *****************************************
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners