Question when reading UPBE

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

Question when reading UPBE

小橙橙
Hi,

    I'm a newcomer in Pharo and start to learn how to use Pharo.
    In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the constant methods and UPBE didn't tell me in which pane to type them.
    Could you tell me ?

Andy Zhu
Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

SergeStinckwich
Dear Andy,

welcome here !

Normally you have to write your code on the bottom pane of the code browser.

Regards,

On Mon, Oct 19, 2015 at 5:49 PM, 小橙橙 <[hidden email]> wrote:
> Hi,
>
>     I'm a newcomer in Pharo and start to learn how to use Pharo.
>     In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the
> constant methods and UPBE didn't tell me in which pane to type them.
>     Could you tell me ?
>
> Andy Zhu



--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

小橙橙
But I don't find the pane on which I should write code. Did you know it?

On Monday, October 19, 2015, Serge Stinckwich <[hidden email]> wrote:
Dear Andy,

welcome here !

Normally you have to write your code on the bottom pane of the code browser.

Regards,

On Mon, Oct 19, 2015 at 5:49 PM, 小橙橙 <<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;zhushuai19890918@gmail.com&#39;)">zhushuai19890918@...> wrote:
> Hi,
>
>     I'm a newcomer in Pharo and start to learn how to use Pharo.
>     In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the
> constant methods and UPBE didn't tell me in which pane to type them.
>     Could you tell me ?
>
> Andy Zhu



--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

Nicolai Hess-3-2
Hi Andy,

on the page before, you see the Figure 3.14, the bottom panel is the code panel.
If you select class LOGame in the second left pane, and for example "-- all --" in the category panel,
every code you put in the code panel, becomes a method of your class "LOGame".

2015-10-19 19:31 GMT+02:00 小橙橙 <[hidden email]>:
But I don't find the pane on which I should write code. Did you know it?


On Monday, October 19, 2015, Serge Stinckwich <[hidden email]> wrote:
Dear Andy,

welcome here !

Normally you have to write your code on the bottom pane of the code browser.

Regards,

On Mon, Oct 19, 2015 at 5:49 PM, 小橙橙 <[hidden email]> wrote:
> Hi,
>
>     I'm a newcomer in Pharo and start to learn how to use Pharo.
>     In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the
> constant methods and UPBE didn't tell me in which pane to type them.
>     Could you tell me ?
>
> Andy Zhu



--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/


Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

SergeStinckwich
In reply to this post by 小橙橙
Have a look to this tutorial here:

https://www.youtube.com/watch?v=gSmlsarDMEQ

On Mon, Oct 19, 2015 at 7:31 PM, 小橙橙 <[hidden email]> wrote:

> But I don't find the pane on which I should write code. Did you know it?
>
>
> On Monday, October 19, 2015, Serge Stinckwich <[hidden email]>
> wrote:
>>
>> Dear Andy,
>>
>> welcome here !
>>
>> Normally you have to write your code on the bottom pane of the code
>> browser.
>>
>> Regards,
>>
>> On Mon, Oct 19, 2015 at 5:49 PM, 小橙橙 <[hidden email]> wrote:
>> > Hi,
>> >
>> >     I'm a newcomer in Pharo and start to learn how to use Pharo.
>> >     In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write
>> > the
>> > constant methods and UPBE didn't tell me in which pane to type them.
>> >     Could you tell me ?
>> >
>> > Andy Zhu
>>
>>
>>
>> --
>> Serge Stinckwich
>> UCBN & UMI UMMISCO 209 (IRD/UPMC)
>> Every DSL ends up being Smalltalk
>> http://www.doesnotunderstand.org/
>>
>



--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

kilon.alios
In reply to this post by 小橙橙
have your read the Pharo Tour chapter ?

please read the entire book from start to finish , DO NOT skip chapters this is a complete tutorial on Pharo that depends on previous chapters for continuation of knowledge. If you dont understand previous chapters you wont understand this.


Your question is explained at Page 16, chapter: A quick tour of Pharo

On Mon, Oct 19, 2015 at 6:50 PM 小橙橙 <[hidden email]> wrote:
Hi,

    I'm a newcomer in Pharo and start to learn how to use Pharo.
    In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the constant methods and UPBE didn't tell me in which pane to type them.
    Could you tell me ?

Andy Zhu
Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

小橙橙
You mean that I  should type them in the pane of the method I want to define, am I right?
then, which one should I type "LOGame>>cellsPerSide" or "cellsPerSide"?
Maybe this syntax --">>" just indicates that this method should belong to this class. but as reader, I don't need to type all, do I ?
My English is poor and When I reader it a little faster, I will be confused. Next time , if I encounter some sentences I don't understand, I will read other sentences around them again.
Thx you all to spare time for my stupid questions :)

2015-10-20 2:02 GMT+08:00 Dimitris Chloupis <[hidden email]>:
have your read the Pharo Tour chapter ?

please read the entire book from start to finish , DO NOT skip chapters this is a complete tutorial on Pharo that depends on previous chapters for continuation of knowledge. If you dont understand previous chapters you wont understand this.


Your question is explained at Page 16, chapter: A quick tour of Pharo

On Mon, Oct 19, 2015 at 6:50 PM 小橙橙 <[hidden email]> wrote:
Hi,

    I'm a newcomer in Pharo and start to learn how to use Pharo.
    In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the constant methods and UPBE didn't tell me in which pane to type them.
    Could you tell me ?

Andy Zhu

Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

kilon.alios
Let me make this clear, I dont believe in stupid questions. Your first language , like me, is not English and so you have harder time to understand documentation. Coding nowdays is as much about learning English than is about learning how to code since its by far the most popular language that coders around the world use to communicate.

So take it step by step and you will be fine.

No next time you dont understand anything you come here and ask question. Ask a thousand questions, we love questions :)

Do not suffer alone !

Now about your questions yes you understand correctly >> means "belongs to". Unfortunately there is a confusing part on the browser , the class button. The class button switches between something called instance side and class side. However this is confusing for newcomers like I was. What really happens is that it switches between the class object itself (instance side) and the metaclass object (class side). Metaclass is basically the class of a class.

To make it clear if we accept here that a Class is a blueprint / factory for our instances , a metaclass is a blueprint/factory for a class. The diffirence if that you can have several instances from the same class but there is only one metaclass for a class.

This happens for example when you issue the command in the Playground.

LOGame new.

The above command creates an instance object using the class object as a blueprint.

But you can have one metaclass of a class , and this is why they share the same name and they appear to be each side of the same coin.

Usually >> refers to the class itself and not the metaclass. No you dont need to type this as you can see.

The diffirence is that if the method is in the metaclass (class side) you dont need to create an isntance fo. Lets take the example where cellsPerSide is a class method

a = LOGame new
a cellsPerSide

we create a variable that hold the instance object created with LOGame class object and then we send the cellsPerSide message

however what happens if the cellsPerSide is in the metaclass ? then we have this

LOGame cellsPerSide

as you can see no need to create instance here since its now a metaclass method. Usually you need a metaclass method when you dont need to operate on specific set of data and instance method when you do. Of course a metaclass method can still have arguments and receive data so this is far form clear rule.

The real power of metaclass is that they can do metaprogramming, what that means is that they can shape and change classes from inside your code which makes them very powerful. You have also metaclass of a metaclass . As a matter of fact a metaclass is an instance of another metaclass. But you dont need to worry about this for now, keep it simple.

On Tue, Oct 20, 2015 at 7:21 AM 小橙橙 <[hidden email]> wrote:
You mean that I  should type them in the pane of the method I want to define, am I right?
then, which one should I type "LOGame>>cellsPerSide" or "cellsPerSide"?
Maybe this syntax --">>" just indicates that this method should belong to this class. but as reader, I don't need to type all, do I ?
My English is poor and When I reader it a little faster, I will be confused. Next time , if I encounter some sentences I don't understand, I will read other sentences around them again.
Thx you all to spare time for my stupid questions :)

2015-10-20 2:02 GMT+08:00 Dimitris Chloupis <[hidden email]>:
have your read the Pharo Tour chapter ?

please read the entire book from start to finish , DO NOT skip chapters this is a complete tutorial on Pharo that depends on previous chapters for continuation of knowledge. If you dont understand previous chapters you wont understand this.


Your question is explained at Page 16, chapter: A quick tour of Pharo

On Mon, Oct 19, 2015 at 6:50 PM 小橙橙 <[hidden email]> wrote:
Hi,

    I'm a newcomer in Pharo and start to learn how to use Pharo.
    In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write the constant methods and UPBE didn't tell me in which pane to type them.
    Could you tell me ?

Andy Zhu

Reply | Threaded
Open this post in threaded view
|

Re: Question when reading UPBE

stepharo
In reply to this post by 小橙橙
please take 5 min and watch this video:

http://sdmeta.gforge.inria.fr/StarterKitCache/Exercises/Exercises-Counter/

stef

Le 19/10/15 17:49, 小橙橙 a écrit :
> Hi,
>
>     I'm a newcomer in Pharo and start to learn how to use Pharo.
>     In page 42 of UPBE(Vesion:2015-10-17 ), I don't know where I write
> the constant methods and UPBE didn't tell me in which pane to type them.
>     Could you tell me ?
>
> Andy Zhu