2017-05-22 15:06 GMT+02:00 Milan Vavra via Pharo-dev <
[email protected]>:

>
>
> ---------- Message transféré ----------
> From: Milan Vavra <[email protected]>
> To: [email protected]
> Cc:
> Bcc:
> Date: Mon, 22 May 2017 06:06:26 -0700 (PDT)
> Subject: Re: Class syntax brainstorming
> >ClassDefinition new
> >       superclass: Object; "optional. If not specified, Object by default
> ;-)"
> >       name: #A; "optional and create an anonymous class if not specified"
> >       instVars: 'a b c';
> >       traits: {TEquality};
> >       package: 'Plop';
> >       createClass. " this message sent might be hidden by the browser
> when
> accepting"
>
>
>
> I would like to suggest to consider replacing
>         instVars: 'a b c';
>
> with
>         instVars: #(
>                 b
>                 a
>                 c
>         );
>

+1 !


>
> That is, to replace the String with names separated by whitespace, by an
> array of Symbols, one name per line.
>
>
> This would make it possible to put comments right next to variable names
> like this:
>
>         instVars: #(
>                 b "comment about b"
>                 a "comment about a"
>                 c "comment about c"
>         );
>
> Which is similar to what can be done in other object oriented languages
> like Java or C++.
>
> This would also make for nice diffs of changes to the class definition -
> when put into git - when instance variables are added, removed or
> renamed.
>
>         instVars: #(
>                 b
> -               a
> +               d
>                 c
>         );
>
>
> Best Regards,
>
> Milan Vavra
>
>
>
> --
> View this message in context: http://forum.world.st/Class-
> syntax-brainstorming-tp4947801p4947858.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>
>

Reply via email to