[squeak-dev] Compiling whitespaces (was: The Inbox: Compiler-ct.418.mcz)
Chris Muller
asqueaker at gmail.com
Wed Feb 19 19:10:04 UTC 2020
-1. You mean you're not using pretty-print just before saving your
methods? It already does that for you. In fact, it even removes any
comments at the end, which I DON'T like...
Formatting and saving should remain two separate gestures, commingling them
would be surprising and frustrating, IMO...
On Wed, Feb 19, 2020 at 5:25 AM Thiede, Christoph <
Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> > > + ^ value!
> > > - ^ value
> > > - !
> >
> > <3 these drive me nutz :-)
> >
> > IMO the UIs around compilation should strip trailing white space
>
> +1, we seem to do the same with leading whitespaces already.
>
> ------------------------------
> *Von:* Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im
> Auftrag von Eliot Miranda <eliot.miranda at gmail.com>
> *Gesendet:* Mittwoch, 19. Februar 2020 11:58 Uhr
> *An:* The general-purpose Squeak developers list
> *Betreff:* Re: [squeak-dev] The Inbox: Compiler-ct.418.mcz
>
>
>
> > On Feb 16, 2020, at 3:31 PM, Levente Uzonyi <leves at caesar.elte.hu>
> wrote:
> >
> > Hi Christoph,
> >
> >> On Sun, 16 Feb 2020, Thiede, Christoph wrote:
> >>
> >> Hi Levente,
> >> actually, I love the Dictionary API with the #ifPresent:ifAbsent:
> arguments as it is very convenient for describing the code paths (IMHO). As
> you may have seen, I am trying to establish it for more domains
> >> (see Collections-ct.873, Collections-ct.872, Collections-ct.875).
> >> If you think it is important to distinguish between classes and
> globals, maybe we should also introduce #classNamed:[ifPresent:][ifAbsent:]
> (three variants) to SmalltalkImage? But this would be a lot of "forwarding
> noise".
> >
> > In my opinion, #classNamed: is fine as-is, because when the class is
> available, the method will return it, when it's not, you'll get nil. No
> other return values are possible.
> > It also supports metaclass lookup, which is not available via #at:*.
>
> +1
>
> >
> > Levente
> >
> >
> >> Best,
> >> Christoph
> >>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> >> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im
> Auftrag von Levente Uzonyi <leves at caesar.elte.hu>
> >> Gesendet: Sonntag, 16. Februar 2020 22:39:13
> >> An: squeak-dev at lists.squeakfoundation.org
> >> Betreff: Re: [squeak-dev] The Inbox: Compiler-ct.418.mcz
> >> Hi Christoph,
> >> The idea with Environments was to move away from the SystemDictionary
> API.
> >> It obviously didn't happen, but there's #classNamed: for class lookup by
> >> name. Actually #classNamed: was there with SystemDictionary too, but it
> >> was and still is underused.
> >> Levente
> >> On Sun, 16 Feb 2020, commits at source.squeak.org wrote:
> >> > Christoph Thiede uploaded a new version of Compiler to project The
> Inbox:
> >> > http://source.squeak.org/inbox/Compiler-ct.418.mcz
> >> >
> >> > ==================== Summary ====================
> >> >
> >> > Name: Compiler-ct.418
> >> > Author: ct
> >> > Time: 16 February 2020, 3:49:08.315 pm
> >> > UUID: 3ca7ba74-6e8b-f64d-bc62-701ebc5df3e0
> >> > Ancestors: Compiler-eem.416
> >> >
> >> > Small refactoring: Use SmalltalkImage >> #at:ifPresent:ifAbsent:.
> >> >
> >> > =============== Diff against Compiler-eem.416 ===============
> >> >
> >> > Item was changed:
> >> > ----- Method: Compiler>>evaluateCue:ifFail: (in category 'private')
> -----
> >> > evaluateCue: aCue ifFail: failBlock
> >> > "Compiles the cue source into a parse tree, then generates
> code into
> >> > a method. Finally, the compiled method is invoked from here
> via withArgs:executeMethod:, hence the system no longer creates Doit method
> >> > litter on errors."
> >> >
> >> > | methodNode method value |
> >> > methodNode := self compileCue: aCue noPattern: true ifFail:
> [^failBlock value].
> >> >
> >> > method := self interactive
> >> > ifTrue: [methodNode
> generateWithTempNames]
> >> > ifFalse: [methodNode generate].
> >> >
> >> > value := cue receiver
> >> > withArgs: (cue context ifNil: [#()]
> ifNotNil: [{cue context}])
> >> > executeMethod: method.
> >> > + ^ value!
> >> > - ^ value
> >> > - !
> >> >
> >> > Item was changed:
> >> > ----- Method: MethodNode>>asColorizedSmalltalk80Text (in category
> 'converting') -----
> >> > asColorizedSmalltalk80Text
> >> > "Answer a colorized Smalltalk-80-syntax string description of
> the parse tree whose root is the receiver."
> >> >
> >> > | printText |
> >> > printText := self printString asText.
> >> > + ^ Smalltalk
> >> > + at: #SHTextStylerST80
> >> > + ifPresent: [:stylerClass | stylerClass new
> styledTextFor: printText]
> >> > + ifAbsent: [printText]!
> >> > - ^(Smalltalk at: #SHTextStylerST80 ifAbsent: [nil])
> >> > - ifNotNil: [:stylerClass| stylerClass new
> styledTextFor: printText]
> >> > - ifNil: [printText]!
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200219/368203b3/attachment.html>
More information about the Squeak-dev
mailing list
|