[Yes, I'll shut up in a minute]
PROPOSAL
Currently, pretty printing doesn't keep the original assignment operator of the source but replaces it with "_". It should however have three modi
* keep it (only applicable if source is available) * always use _ * always use :=
For fileout, another (two) options might be useful:
* replace _ with :=, but don't touch any other formatting * replace := with _, but don't touch any other formatting
this is more as a simple find/replace as it should of course not touch strings or symbols or literals.
BACKWARD COMPATIBILITY ISSUES
None, if we set the switch to the right value.
ADVANTAGES
ANSI conformance as well as conform with VisualWorks, Dolphin ST, VisualAge and probabyl also other Smalltalk systems.
IMPLEMENTATION ISSUES
AssignmentNode>>printOn:indent: is the place to change if printing. The switch should be added as class variable to Scanner or Parser though.
Parser>>assignment: needs to be changed to keep the current assignment operator, as well as Scanner>>xColon and Parser>>expression. The easiest way is to add a flag to AssignmentNode and introduce #assignmentOp additional to #leftArrow.
bye -- Stefan Matthias Aust // Bevor wir fallen, fallen wir lieber auf
On Sun, May 28, 2000 at 07:46:02PM +0200, Stefan Matthias Aust wrote:
[Yes, I'll shut up in a minute]
PROPOSAL
Currently, pretty printing doesn't keep the original assignment operator of the source but replaces it with "_". It should however have three modi
- keep it (only applicable if source is available)
- always use _
- always use :=
[...]
What I'd like to see (taking this to extremes) is a pretty-printer that is highly configurable so that everybody can define their own favourite indentation/formatting style. (Think indentation styles in emacs' C mode.) Choice of assignment operator would, of course be part of this.
This way, we can all have our favourite styles automagically. Plus, a reformat won't erase your painstakingly hand-formatted code into the default style, nor will the code browser show all sorts of spurious differences between the same method but with different formats (well, not if it first formats them both to the same style, that is.)
--Chris
Chris Reuter wrote:
On Sun, May 28, 2000 at 07:46:02PM +0200, Stefan Matthias Aust wrote:
[Yes, I'll shut up in a minute]
PROPOSAL
Currently, pretty printing doesn't keep the original assignment operator of the source but replaces it with "_". It should however have three modi
- keep it (only applicable if source is available)
- always use _
- always use :=
[...]
What I'd like to see (taking this to extremes) is a pretty-printer that is highly configurable so that everybody can define their own favourite indentation/formatting style. (Think indentation styles in emacs' C mode.) Choice of assignment operator would, of course be part of this.
This way, we can all have our favourite styles automagically. Plus, a reformat won't erase your painstakingly hand-formatted code into the default style, nor will the code browser show all sorts of spurious differences between the same method but with different formats (well, not if it first formats them both to the same style, that is.)
--Chris
I agree !!! This would make life easier, flame wars shorter and most people happy. Then everybody could sit at home and make their own syntax and file it out as ansi or Squeak or whatever.
Karl
At 02:03 03.06.00 -0400, Chris Reuter wrote:
What I'd like to see (taking this to extremes) is a pretty-printer that is highly configurable so that everybody can define their own favourite indentation/formatting style.
Sure, who'll volunteer to build this? ;-) Is there some existing code one could use? I was told that the Refactoring Browser, for example, as its own formatter - is that customizable?
bye -- Stefan Matthias Aust \ Truth Until Paradox
squeak-dev@lists.squeakfoundation.org