Variables

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

Variables

Vitor Medina Cruz
Hello,

1) Variables in Smalltalk are not objects? I mean:

variableA := someObject.

Does not translate to some object receiving a message?

If that is true, this means I cannot create variables and that I cannot look at the local variables of a method at run time?


2) Is there a way to both declare and define variables (instance or local) in Smalltalk? As far as I know, I must first declare and them define them:

| variableA |

variableA := true.

But I would like to:

| variableA := true | (or something)

If there is something I miss from others languages it is the variable declarations. For example, I fell

def  variableA := true

much more expressive than in Smalltalk, don't you?

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "Redline Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Variables

James Ladd
Hi Vitor,

Thank you for your continued interest and questions.

You are right, := is not a message that is sent to an object to cause assignment.

I think that creation and initialization in one step is neat, however it is not Smalltalk.

For now Redline will be a Smalltalk and won't implement these sorts of changes.

- James.



On Thu, Jun 20, 2013 at 4:35 AM, Vitor Cruz <[hidden email]> wrote:
Hello,

1) Variables in Smalltalk are not objects? I mean:

variableA := someObject.

Does not translate to some object receiving a message?

If that is true, this means I cannot create variables and that I cannot look at the local variables of a method at run time?


2) Is there a way to both declare and define variables (instance or local) in Smalltalk? As far as I know, I must first declare and them define them:

| variableA |

variableA := true.

But I would like to:

| variableA := true | (or something)

If there is something I miss from others languages it is the variable declarations. For example, I fell

def  variableA := true

much more expressive than in Smalltalk, don't you?

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "Redline Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Redline Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.