[Cuis-dev] Feature #require: completion event or test?
Alexandre Rousseau
yalexr at gmail.com
Tue Mar 21 17:21:16 PDT 2023
Thanks Ken. Makes sense.
On Tue, Mar 21, 2023 at 5:41 PM <ken.dickey at whidbey.com> wrote:
> On 2023-03-21 12:57, Alexandre Rousseau via Cuis-dev wrote:
>
> > My point was the system complained that "MyTheme beCurrent " , scripted
> > after the loading of said packaged theme, was pointing to a non
> > existent class ... i.e., the loading was not complete when the
> > "beCurrent" message was sent. Which makes the loading of packages
> > asynchronous, does it not?
>
> Actually, not. It is a processing time problem.
>
> The code is first compiled as _a block_ and when that happens
> #ClassicTheme is undefined, so nil.
>
> If you initially type
> Feature require: #'Theme-Themes'.
> ClassicTheme beCurrent.
> into a workspace, you will see #ClassicTheme in RED because it is yet
> undefined.
>
> If you select both lines and DoIt, you will get the #ClassicTheme
> undefined exception, but if you select the first line and DoIt, then you
> will note #ClassicTheme has turned BLUE as it is now defined. You can
> select the 2nd line and DoIt, AOK.
>
> Since you are sending a block of text to be compiled at one time, you
> have to deal with undefined values _at the time the text is compiled_.
>
> The easy fix in this case is to compile-in the explicit code to do the
> lookup:
> Feature require: #'Theme-Themes'.
> (Smalltalk at: #ClassicTheme) beCurrent.
>
> Note that I do not find this very intuitive either.
>
> HTH,
> -KenD
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230321/b139f672/attachment.htm>
More information about the Cuis-dev
mailing list