<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">Not sure why you think it's busted. It's been
      that way for a very long time and Class&gt;&gt;environment seems
      to take care of things:<br>
      <br>
      environment<br>
      <br>
          environment == nil ifTrue: [^ super environment].<br>
          ^ environment<br>
      <br>
      Cheers,<br>
      Bob<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 7/10/13 5:38 PM, Frank Shearar
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJbhyRF-HkH8-9pkg4siMJMdbvhVmjYjkpgwek-6Nth42=M=zA@mail.gmail.com"
      type="cite">
      <pre wrap="">On 10 July 2013 22:19, Frank Shearar <a class="moz-txt-link-rfc2396E" href="mailto:frank.shearar@gmail.com">&lt;frank.shearar@gmail.com&gt;</a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 10 July 2013 20:44, David T. Lewis <a class="moz-txt-link-rfc2396E" href="mailto:lewis@mail.msen.com">&lt;lewis@mail.msen.com&gt;</a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">On Wed, Jul 10, 2013 at 07:21:56PM +0100, Frank Shearar wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">On 10 July 2013 19:02, Colin Putney <a class="moz-txt-link-rfc2396E" href="mailto:colin@wiresong.com">&lt;colin@wiresong.com&gt;</a> wrote:
</pre>
            <blockquote type="cite">
              <pre wrap="">


On Wed, Jul 10, 2013 at 6:52 AM, Frank Shearar <a class="moz-txt-link-rfc2396E" href="mailto:frank.shearar@gmail.com">&lt;frank.shearar@gmail.com&gt;</a>
wrote:

</pre>
              <blockquote type="cite">
                <pre wrap="">
Er, so should we ever have classes with a nil environment? Is my
proposed change a stinky hack, or the right thing to do to lazily fix
the issue?
</pre>
              </blockquote>
              <pre wrap="">

We should never have classes with a nil environment.
</pre>
            </blockquote>
            <pre wrap="">

OK, that's what I thought. But I have such an image. In fact, I
daresay that every alpha image produced in the 4.5 line has for months
and months had such classes. Making #declare: use the #environment
method instead of directly accessing the instvar "solves" the problem
- Morphic-fbs.633 will load - but I have no idea if that's a good
solution, or a bad, bad bandaid.

</pre>
          </blockquote>
          <pre wrap="">
I have run into the nil environment problem in the course of updating
images from trunk, so I suspect there is or was some kind of problem
at some point. I worked around it manually in the update whenever a
debugger popped up. The "fix" was to look at the class in the debugger,
and do "environment := Array environment" (I used Array, but it could
be any class that does have its environment set properly).

That seemed to work but I'm sure there must be a better way to do it.
Is there something we should put into the trunk update stream so that
other people don't get stuck on the problem during updates?

Dave
</pre>
        </blockquote>
        <pre wrap="">
I sort've expected to see an explicit assigning of environments
somewhere. But Environment class &gt;&gt; #install doesn't do this. It
inserts itself in Smalltalk globals' place, which is great if a (class
instVarNamed: 'environment') == Smalltalk globals. But if a class'
environment was already nil, installing Environments would not have
touched the instvar, leaving busted state. (As in, leaving busted
state in the same, busted, state.)
</pre>
      </blockquote>
      <pre wrap="">
And lo! In a Squeak 4.4 image:

(Class allSubclasses collect: #theNonMetaClass) select: [:cls | (cls
instVarNamed: 'environment') isNil]
"=&gt; " an OrderedCollection(ProtoObject ObjectViewer ObjectOut
BalloonState SoundCodec UndefinedObject Boolean SimpleMIDIPort
FillStyle Password SharedQueue MidiPrimTester MailAddressParser
WindowingTransformation FormButtonCache BalloonEdgeData View
AbstractScoreEvent LimitingLineStreamWrapper Message
EllipseMidpointTracer DamageRecorder ImageReadWriter TextContainer
MIDIScore ClassCategoryReader BalloonSolidFillSimulation
MorphExtension MIDISynth MIMEDocument FWT TextAttribute MIDIFileReader
Stream Link BalloonBuffer SerialPort MimeConverter CornerRounder
CompressedBoundaryShape MailAddressToken BalloonLineSimulation
DiskProxy LineSegment Point DisplayObject CompressedSoundData
InstructionStream BalloonFillData GraphicSymbolInstance PluggableTest
KeyboardBuffer ParseStack Morph MIDISynthChannel DisplayTransform
ObjectScanner Envelope SampledInstrument MIDIInputParser ClassBuilder
FFT ExceptionSet ObjectViewer WaveletCodec MuLawCodec GSMCodec
ADPCMCodec True False OrientedFillStyle SolidFillStyle Pen WarpBlt
FormView DisplayTextView StringHolderView ListView PluggableButtonView
Number LookupKey NoteEvent ControlChangeEvent PitchBendEvent
ProgramChangeEvent AmbientEvent TempoEvent DualChangeSorter
TranslucentColor PCXReadWriter XBMReadWriter Quadrangle Bag
SequenceableCollection TextAction TextKern TextEmphasis TextIndent
TextColor TextFontChange PositionableStream DummyStream
QuotedPrintableMimeConverter RepeatingSound ScorePlayer
SequentialSound RestSound ReverbSound FMSound PluckedSound MixedSound
UnixFileDirectory DosFileDirectory Bezier2Segment Bezier3Segment
DisplayText DisplayMedium Path InfiniteForm GenericUrl
PianoRollNoteMorph ImageMorph MenuLineMorph StringMorph BorderedMorph
MovieMorph MatrixTransform2x3 CompositeTransform MorphicTransform
VolumeEnvelope RandomEnvelope PitchEnvelope SoundInputStream
AssignmentNode DecompilerConstructor CascadeNode BraceNode Error
IllegalResumeAttempt Notification FormMenuController ModalController
NoController BitmapFillStyle FormHolderView FormInspectView
FillInTheBlankView PluggableTextView PluggableListView FormEditorView
ColorSystemView Fraction Association SyntaxError SelectorBrowser
ArrayedCollection LinkedList OrderedCollection Interval TextDoIt
TextLink TextURL TextFontReference ReadStream WriteStream
RFC2047MimeConverter FMClarinetSound FMBassoonSound UnloadedSound Form
Spline CurveFitter Line LinearFit Arc BlockContext MailtoUrl
BrowserUrl HttpUrl FtpUrl ThreePhaseButtonMorph Sonogram
PopUpChoiceMorph MorphicModel RectangleMorph Canvas SelectorNode
VariableNode LiteralNode MessageAsTempNode ExceptionAboutToReturn
Warning PluggableListViewByItem SmallInteger LargePositiveInteger
WeakKeyAssociation OrderedCollectionInspector DictionaryInspector
InspectorBrowser ChangeList WordArray RunArray Array ShortIntegerArray
Bitmap FloatArray ShortRunArray ByteArray IntegerArray Semaphore
GraphicSymbol TextLineInterval IdentityDictionary WeakValueDictionary
PluggableDictionary TextSqkPageLink LimitedWriteStream ReadWriteStream
TextStream ListParagraph ColorForm Circle NameStringInHalo
ProjectController ListController LargeNegativeInteger
ChangeListForProjects FileContentsBrowser PackagePaneBrowser
ChangedMessageSet RecentMessageSet TimeProfileBrowser ShortPointArray
PointArray RWBinaryOrTextStream Transcripter CursorWithMask
PreDebugWindow SystemWindowWithButton ScorePlayerMorph
UpdatingSimpleButtonMorph TextMorphForEditView StringMorphEditor
ColorPatchCanvas PluggableListController PluggableListControllerOfMany
FillInTheBlankController PluggableTextController
ReadOnlyTextController)

Note PianoRollNoteMorph's presence in the list! So. It's not
Environments' fault, because it just replaced Smalltalk globals. It's
just long old busted state. We thus need (a) an update step to fix the
busted state or (b) lazily correct it.

</pre>
      <blockquote type="cite">
        <pre wrap="">frank
</pre>
      </blockquote>
      <pre wrap="">

</pre>
    </blockquote>
    <br>
  </body>
</html>