[feature] Pragma for accessors

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

[feature] Pragma for accessors

MrGwen
Issue status update for
http://smalltalk.gnu.org/node/449
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/449

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  MrGwen
 Updated by:   MrGwen
 Status:       active

Instead of doint
Object subclass: Foo [
 | a b c |

  a []
  a: anObject [ ]
  ...
]

Why not :

Object subclass: Foo [

 
]




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Pragma for accessors

MrGwen
On Mon, 2010-01-11 at 23:48 -0700, Gwenael Casaccio wrote:

> Issue status update for
> http://smalltalk.gnu.org/node/449
> Post a follow up:
> http://smalltalk.gnu.org/project/comments/add/449
>
>  Project:      GNU Smalltalk
>  Version:      <none>
>  Component:    Base classes
>  Category:     feature requests
>  Priority:     normal
>  Assigned to:  Unassigned
>  Reported by:  MrGwen
>  Updated by:   MrGwen
>  Status:       active
>
> Instead of doint
> Object subclass: Foo [
>  | a b c |
>
>   a []
>   a: anObject [ ]
>   ...
> ]
>
> Why not :
>
> Object subclass: Foo [
>
>  
> ]
>
That is

Object subclass: Foo [

  <accessors: {#a. #b. #c}>
]

>
>
>
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Pragma for accessors

Stefan Schmiedl
In reply to this post by MrGwen
Issue status update for
http://smalltalk.gnu.org/project/issue/449
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/449

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  MrGwen
 Updated by:   swsch
 Status:       active

Would that pragma both declare the variables and define readers and
writers?

If so, wouldn't it make sense to also have similar 'reader' and
'writer' pragmas, only defining the respective methods?




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Pragma for accessors

Nicolas Petton
In reply to this post by MrGwen
Isn't that what you looking for?
http://smalltalk.gnu.org/blog/sdp/accessing-succinctly

Cheers!

Nico


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk