The Trunk: Compiler-cmm.275.mcz

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

The Trunk: Compiler-cmm.275.mcz

commits-2
Chris Muller uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-cmm.275.mcz

==================== Summary ====================

Name: Compiler-cmm.275
Author: cmm
Time: 3 October 2013, 2:34:56.409 pm
UUID: 9d002330-e75e-436f-8699-b29413e98e81
Ancestors: Compiler-nice.274

When loading code, don't blow up just because of an undeclared ref.

=============== Diff against Compiler-nice.274 ===============

Item was changed:
  ----- Method: Encoder>>undeclared: (in category 'encoding') -----
+ undeclared: name
- undeclared: name
  | sym |
  requestor interactive ifTrue:
+ [ requestor requestor == #error: ifTrue: [ requestor error: 'Undeclared' ].
+ ^ self notify: 'Undeclared' ].
- [requestor requestor == #error: ifTrue:
- [requestor error: 'Undeclared'].
- ^self notify: 'Undeclared'].
  "Allow knowlegeable clients to squash the undeclared warning if they want (e.g.
  Diffing pretty printers that are simply formatting text).  As this breaks
  compilation it should only be used by clients that want to discard the result
  of the compilation.  To squash the warning use e.g.
  [Compiler format: code in: class notifying: nil decorated: false]
  on: UndeclaredVariableWarning
  do: [:ex| ex resume: false]"
  sym := name asSymbol.
+ ^ (UndeclaredVariableWarning new
+ name: name
+ selector: selector
+ class: cue getClass) signal
- ^(UndeclaredVariableWarning new name: name selector: selector class: cue getClass) signal
  ifTrue:
+ [ | undeclared |
- [| undeclared |
  undeclared := cue environment undeclared.
+ [ undeclared
+ at: sym
+ put: nil ]
+ on: AttemptToWriteReadOnlyGlobal
+ do: [ : noti | noti resume: true ].
+ self
+ global: (undeclared associationAt: sym)
+ name: sym ]
- undeclared at: sym put: nil.
- self global: (undeclared associationAt: sym) name: sym]
  ifFalse:
+ [ self
+ global: (Association key: sym)
+ name: sym ]!
- [self global: (Association key: sym) name: sym]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-cmm.275.mcz

Chris Muller-3
The reformatting caused almost all lines to be dif'd.  The only change
is handling AttemptToWriteReadOnlyGlobal on the at:put:.

On Thu, Oct 3, 2013 at 2:35 PM,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-cmm.275.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-cmm.275
> Author: cmm
> Time: 3 October 2013, 2:34:56.409 pm
> UUID: 9d002330-e75e-436f-8699-b29413e98e81
> Ancestors: Compiler-nice.274
>
> When loading code, don't blow up just because of an undeclared ref.
>
> =============== Diff against Compiler-nice.274 ===============
>
> Item was changed:
>   ----- Method: Encoder>>undeclared: (in category 'encoding') -----
> + undeclared: name
> - undeclared: name
>         | sym |
>         requestor interactive ifTrue:
> +               [ requestor requestor == #error: ifTrue: [ requestor error: 'Undeclared' ].
> +               ^ self notify: 'Undeclared' ].
> -               [requestor requestor == #error: ifTrue:
> -                       [requestor error: 'Undeclared'].
> -                ^self notify: 'Undeclared'].
>         "Allow knowlegeable clients to squash the undeclared warning if they want (e.g.
>          Diffing pretty printers that are simply formatting text).  As this breaks
>          compilation it should only be used by clients that want to discard the result
>          of the compilation.  To squash the warning use e.g.
>                 [Compiler format: code in: class notifying: nil decorated: false]
>                         on: UndeclaredVariableWarning
>                         do: [:ex| ex resume: false]"
>         sym := name asSymbol.
> +       ^ (UndeclaredVariableWarning new
> +               name: name
> +               selector: selector
> +               class: cue getClass) signal
> -       ^(UndeclaredVariableWarning new name: name selector: selector class: cue getClass) signal
>                 ifTrue:
> +                       [ | undeclared |
> -                       [| undeclared |
>                         undeclared := cue environment undeclared.
> +                       [ undeclared
> +                               at: sym
> +                               put: nil ]
> +                               on: AttemptToWriteReadOnlyGlobal
> +                               do: [ : noti | noti resume: true ].
> +                       self
> +                               global: (undeclared associationAt: sym)
> +                               name: sym ]
> -                       undeclared at: sym put: nil.
> -                       self global: (undeclared associationAt: sym) name: sym]
>                 ifFalse:
> +                       [ self
> +                               global: (Association key: sym)
> +                               name: sym ]!
> -                       [self global: (Association key: sym) name: sym]!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-cmm.275.mcz

Bert Freudenberg
On 2013-10-03, at 23:02, Chris Muller <[hidden email]> wrote:

> The reformatting caused almost all lines to be dif'd.  The only change
> is handling AttemptToWriteReadOnlyGlobal on the at:put:.

I find the compact form the code had before a lot more readable.

- Bert -

>
> On Thu, Oct 3, 2013 at 2:35 PM,  <[hidden email]> wrote:
>> Chris Muller uploaded a new version of Compiler to project The Trunk:
>> http://source.squeak.org/trunk/Compiler-cmm.275.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Compiler-cmm.275
>> Author: cmm
>> Time: 3 October 2013, 2:34:56.409 pm
>> UUID: 9d002330-e75e-436f-8699-b29413e98e81
>> Ancestors: Compiler-nice.274
>>
>> When loading code, don't blow up just because of an undeclared ref.
>>
>> =============== Diff against Compiler-nice.274 ===============
>>
>> Item was changed:
>>  ----- Method: Encoder>>undeclared: (in category 'encoding') -----
>> + undeclared: name
>> - undeclared: name
>>        | sym |
>>        requestor interactive ifTrue:
>> +               [ requestor requestor == #error: ifTrue: [ requestor error: 'Undeclared' ].
>> +               ^ self notify: 'Undeclared' ].
>> -               [requestor requestor == #error: ifTrue:
>> -                       [requestor error: 'Undeclared'].
>> -                ^self notify: 'Undeclared'].
>>        "Allow knowlegeable clients to squash the undeclared warning if they want (e.g.
>>         Diffing pretty printers that are simply formatting text).  As this breaks
>>         compilation it should only be used by clients that want to discard the result
>>         of the compilation.  To squash the warning use e.g.
>>                [Compiler format: code in: class notifying: nil decorated: false]
>>                        on: UndeclaredVariableWarning
>>                        do: [:ex| ex resume: false]"
>>        sym := name asSymbol.
>> +       ^ (UndeclaredVariableWarning new
>> +               name: name
>> +               selector: selector
>> +               class: cue getClass) signal
>> -       ^(UndeclaredVariableWarning new name: name selector: selector class: cue getClass) signal
>>                ifTrue:
>> +                       [ | undeclared |
>> -                       [| undeclared |
>>                        undeclared := cue environment undeclared.
>> +                       [ undeclared
>> +                               at: sym
>> +                               put: nil ]
>> +                               on: AttemptToWriteReadOnlyGlobal
>> +                               do: [ : noti | noti resume: true ].
>> +                       self
>> +                               global: (undeclared associationAt: sym)
>> +                               name: sym ]
>> -                       undeclared at: sym put: nil.
>> -                       self global: (undeclared associationAt: sym) name: sym]
>>                ifFalse:
>> +                       [ self
>> +                               global: (Association key: sym)
>> +                               name: sym ]!
>> -                       [self global: (Association key: sym) name: sym]!
>>
>>
>