<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Please see below.<br>
<br>
HTH,<br>
<br>
Gerald<br>
<br>
On 3/24/23 2:34 PM, Alexandre Rousseau wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAKmOayKftMm_BvR0kSSGzd0WjDBJpnkfDGAzRzScNJbS4a2CRQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<blockquote class="gmail_quote">Do you really need an instance
variable?</blockquote>
<div>Yes. I would like to submit some (minor modification and
impact) change sets for BoxedMorph and PluggableButtonMorph,
for eventual discussion (somewhat related to theming).</div>
<div><br>
</div>
<div><br>
<blockquote class="gmail_quote">There is a method <tt>Class>>#addInstVarName:</tt> that
lets you add instance variables.</blockquote>
</div>
<div>Perfect, thanks.<br>
</div>
<div><br>
<br>
<blockquote class="gmail_quote">You can use the <tt>-e</tt> command-line
option to execute code from the command line.</blockquote>
<div>Hmmm. Where did you find out about the -e option? I am
running this on macOS</div>
<div>(obtained from <a
href="https://github.com/OpenSmalltalk/opensmalltalk-vm"
moz-do-not-send="true">https://github.com/OpenSmalltalk/opensmalltalk-vm</a>)
and invoking</div>
<div>./Squeak.app/Contents/MacOS/Squeak -help outputs:<br>
</div>
</div>
<div><br>
</div>
<div>
<blockquote class="gmail_quote">$
./Squeak.app/Contents/MacOS/Squeak -h<br>
unknown option: -h<br>
Usage: Squeak [<option>...] [<imageName>
[<argument>...]]<br>
./Squeak.app/Contents/MacOS/Squeak
[<option>...] -- [<argument>...]<br>
Common <option>s:<br>
-help print this help message, then exit<br>
-memory <size>[kmg] use fixed heap size (added to
image size)<br>
-nohandlers disable sigsegv & sigusr1
handlers<br>
-timephases print start load and run times<br>
-breaksel selector set breakpoint on send of selector<br>
-failonffiexception when in an FFI callout primitive
catch exceptions and fail the primitive<br>
-breakmnu selector set breakpoint on MNU of selector<br>
-eden <size>[kmg] set eden memory to bytes<br>
-leakcheck num check for leaks in the heap<br>
-stackpages num use n stack pages<br>
-numextsems num make the external semaphore table
num in size<br>
-noheartbeat disable the heartbeat for VM
debugging. disables input<br>
-pollpip (0|1) output on each poll for input<br>
-eventtrace mask print input events with types in
mask to stderr<br>
-logplugin name only log primitives in plugin<br>
-trace[=num] enable tracing (optionally to a
specific value)<br>
-warnpid print pid in warnings<br>
-codesize <size>[mk] set machine code memory to
bytes<br>
-tracestores enable store tracing (assert check
stores)<br>
-cogmaxlits <n> set max number of literals for
methods to be compiled to machine code<br>
-cogminjumps <n> set min number of backward
jumps for interpreted methods to be considered for
compilation to machine code<br>
-reportheadroom report unused stack headroom on exit<br>
-maxoldspace <size>[kmg] set max size of old space
memory to bytes<br>
-logscavenge log scavenging to scavenge.log<br>
-headless run in headless (no window) mode
(default: false)<br>
-headfull run in headful (window) mode
(default: true)<br>
-opengl use OpenGL for drawing the VM
window. Must be the first argument.<br>
-core-graphics use CoreGraphics for drawing the VM
window. Must be the first argument.<br>
-metal use Metal for drawing the VM window.
Must be the first argument.<br>
-version print version information, then exit<br>
-blockonerror on error or segv block, not exit.
useful for attaching gdb<br>
-blockonwarn on warning block, don't warn.
useful for attaching gdb<br>
-exitonwarn treat warnings as errors, exiting on
warn<br>
Notes:<br>
<imageName> defaults to `squeak.image'.<br>
If '-memory' or '-maxoldspace' are not specified then the
heap will grow dynamically.<br>
<argument>s are ignored, but are processed by the
Squeak image.<br>
The first <argument> normally names a Squeak
`script' to execute.<br>
Precede <arguments> by `--' to use default image.</blockquote>
<br>
</div>
<blockquote class="gmail_quote">$
./Squeak.app/Contents/MacOS/Squeak -version<br>
5.0 5.20220602.1410 Mac OS X built on Jun 2 2022 15:55:29 UTC
Compiler: Apple LLVM 12.0.0 (clang-1200.0.32.29) [Production
Spur 64-bit x64 VM]<br>
CoInterpreter VMMaker.oscog-dtl.3185 uuid:
0e7f07b8-eed6-4362-b223-86c98594ddb9 Jun 2 2022<br>
StackToRegisterMappingCogit VMMaker.oscog-mt.3179 uuid:
c6fbcb07-2a19-ed4f-8b40-9c119a70882a Jun 2 2022<br>
VM: 202206021410
<a class="moz-txt-link-abbreviated" href="mailto:runner@Mac-1654183989075.local:work/opensmalltalk-vm/opensmalltalk-vm">runner@Mac-1654183989075.local:work/opensmalltalk-vm/opensmalltalk-vm</a><br>
Date: Thu Jun 2 16:10:44 2022 CommitHash: c9fd365<br>
Plugins: 202206021410
<a class="moz-txt-link-abbreviated" href="mailto:runner@Mac-1654183989075.local:work/opensmalltalk-vm/opensmalltalk-vm">runner@Mac-1654183989075.local:work/opensmalltalk-vm/opensmalltalk-vm</a></blockquote>
</div>
</blockquote>
Do something like:<br>
squeak Cuis6.0-????.image -h<br>
<br>
This will display a help text and briefly open the vm window.<br>
<blockquote type="cite"
cite="mid:CAKmOayKftMm_BvR0kSSGzd0WjDBJpnkfDGAzRzScNJbS4a2CRQ@mail.gmail.com"><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Mar 24, 2023 at
4:23 AM Gerald Klix via Cuis-dev <<a
href="mailto:cuis-dev@lists.cuis.st" moz-do-not-send="true">cuis-dev@lists.cuis.st</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote">
<div>
<div>On 3/24/23 8:31 AM, Alexandre Rousseau via Cuis-dev
wrote:<br>
</div>
<blockquote type="cite">
<pre>I'm trying to modify rather than subclass BoxedMorp, adding a new instance
var to the class definition. This fails while Transcript reports what
follows.
I'm guessing that recompilation of BoxedMorph does not play well while a
WorldMorph (a subclass of BoxedMorph itself) instance is running.
What would be a way to work around this?
Class reshaping: InnerTextMorph has some instance running #acceptContents.
</pre>
<blockquote type="cite">
<pre>This CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: InnerTextMorph has some instance running
#processKeystrokeEvent:. This CompiledMethod would become invalid. Class
reshaping aborted.
Class reshaping: InnerTextMorph has some instance running
#processKeystrokeEvent:. This CompiledMethod would become invalid. Class
reshaping aborted.
Class reshaping: InnerTextMorph has some instance running #keyStroke:.
This CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: InnerTextMorph has some instance running #keyStroke:.
This CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: HandMorph has some instance running
#startKeyboardDispatch:. This CompiledMethod would become invalid. Class
reshaping aborted.
Class reshaping: HandMorph has some instance running #processEventQueue.
This CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: WorldMorph has some instance running #doOneCycleNow. This
CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: WorldMorph has some instance running #handsDo:. This
CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: WorldMorph has some instance running #doOneCycleNow. This
CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: WorldMorph has some instance running #doOneCycle:. This
CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: WorldMorph has some instance running #mainLoop. This
CompiledMethod would become invalid. Class reshaping aborted.
Class reshaping: WorldMorph has some instance running #mainLoop. This
CompiledMethod would become invalid. Class reshaping aborted.
</pre>
</blockquote>
<br>
<fieldset></fieldset>
</blockquote>
First, let me analyze that problem.<br>
Nearly every Morph you see on the screen – <tt>SystemWindow</tt>
and <br>
thus <tt>BrowserWindow</tt> – is derived from <tt>BoxedMorph</tt>.
Juan added save guards<br>
to Object>>#become:, because adding the target object
of <tt>#become:</tt><br>
might still have some active contexts on the stack and these<br>
active contexts refer to methods that where compiled for the<br>
source object of <tt>#bceome:</tt>. In your case the source
object<br>
is the old class and the target object is the new class,
with<br>
the added instance variable. If you will add the instance
variable<br>
add the end, it would work out. Otherwise some<br>
morphic code in the running system will certainly crash.<br>
<br>
Now for ways around this mess:<br>
<br>
Do you really need an instance variable?<br>
Morphs also have properties, that should<br>
be used if the instance variable is <tt>nil</tt> for<br>
most morphs. Properties come in handy here,<br>
because the can be added at run-time.<br>
<br>
If you insist on adding instance variables,<br>
you have to add your variable with<br>
no morphic code on the stack, meaning you have to <br>
do it from the command line.<br>
There is a method <tt>Class>>#addInstVarName:</tt>
that lets<br>
you add instance variables.<br>
<br>
You can use the <tt>-e</tt> command-line option<br>
to execute code from the command line.<br>
<br>
<br>
HTH,<br>
<br>
Gerald<br>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank"
moz-do-not-send="true">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>