help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [RFC] New Smalltalk syntax v2


From: Paolo Bonzini
Subject: [Help-smalltalk] [RFC] New Smalltalk syntax v2
Date: Fri, 16 Mar 2007 09:28:32 +0100
User-agent: Thunderbird 1.5.0.10 (Macintosh/20070221)

Here is what I collected from the thread:

--------------

1) Parts that Daniele will implement together with a
conversion tool:

1.a) Simple Doits: currently they do nothing, but plans for the
future are at the end of this email.

      Eval [
      ]

1.b) Set/create namespace and Doit:

      Namespace current: SystemExceptions [
      ]

1.c) Class definition: a pure Smalltalk syntax is impossible,
but we can make it more palatable.

      SomeNamespace.ClassName subclass: SubclassName [
      ]

(want a sharp before subclass name?  That could be negotiable :-)
if there is consensus).

1.c.a) Instance/class-instance variable definition:

      | a b c |

1.c.b) Method definition:

      a: b c: d [
      ]

      "ClassName must be the current class or a superclass"
      ClassName >> a: b c: d [
      ]

      "ClassName must be the current class or a superclass"
      ClassName class >> a: b c: d [
      ]

1.c.c) Method category definition (see below too):

      Method for: 'category' [
      ]

1.c.d) Switch to class side:

      Class protocol [
      ]

1.c.e) Class comments:

      <comment: ''>

1.c.f) Pool dictionaries:

      <import: SystemExceptions>

1.c.g) Class variables:

      Foo := Dictionary new.

1.d) Class extension: likewise -- no need to stick to the
keyword syntax.

      SomeNamespace.ClassName extend [
      ]

      SomeNamespace.ClassName class extend [
      ]

Syntax as above.

--------------

2) Parts that I will implement soon:

2.a) Convert class variables to c-i variables where appropriate.

I started looking at this.  There are some places where
c-i variables are *not* appropriate and yet the values are
not constant.  In this case, the best solution would have been
to create a singleton class and move the class variables to
be instance variables of the singleton instance.

2.b) Add <category: ...> pragma to override current compilation
category (so that item "1.c.c" in the above list is not
necessary).

--------------

3) Parts that I or Daniele will implement as time permits:

3.a) Doits do not require temporary variables to
be declared.  The compiler will warn if such an auto-temporary
starts with an uppercase letter.

3.b) Doits out of an Eval will evaluate each statement separately.

3.c) A bang (out of an Eval) or the end of the Eval will clear
any automatically generated temporaries.


All these features are *necessary*, though, for the next release
to not be something half-cooked.

--------------

Anything I missed?  Anything I got wrong?  Please let's keep
this thread more structured, reply under each item of the above
list.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]