old vs new format

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

old vs new format

Jan Vrany-2
Hi guys,

there is an interesting problem with new syntax and
method sources. Although new syntax is cool for writing
scripts in text editor, in GUI browser I whould like to
have old syntax in code pane, i.e
--
some: method
        ^method source
--
instead of
some: method [
        <category: 'some methods'>
        ^method source
]
--

Because method source is just a reference to the source code file,
the only possibility is to use RBFormatter to format source code in
old syntax. But all hand-made formating will be lost. Any other idea?

Cheers, Jan



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

Re: old vs new format

Paolo Bonzini

> there is an interesting problem with new syntax and
> method sources. Although new syntax is cool for writing
> scripts in text editor, in GUI browser I whould like to
> have old syntax in code pane, i.e

The coexisting between old and new format is a problem that will be
solved later, as soon as all the source code has been converted to the
new syntax.  It is the root cause of the mutate.st expected failure in
"make check".

In the end, compilation of a single method (Behavior>>#compile:) will
have to accept methods with brackets, or class mutation won't work.

> Because method source is just a reference to the source code file,
> the only possibility is to use RBFormatter to format source code in
> old syntax. But all hand-made formating will be lost. Any other idea?

I don't mind seeing <category: ''> in the browser, especially since GNU
Smalltalk's browser does not have drag'n'drop to move methods between
categories.

I agree though that the brackets would look a little "foreign" in the
browser.  The simplest solution is to:

1) detect methods whose original source code has no brackets, and use
RBFormatter on those only.  Methods with brackets won't be passed
through the RBFormatter.

2) if there is request, we can remove the brackets when showing code in
the browser, and add them back just before compiling.  It shouldn't be
that hard.

Paolo


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