<div dir="ltr">There were some 'features' like that in the S3 compiler in the days I still wrote commercial Oberon code..<div>An intermediate variable always fixed the problem. As in your first example.</div><div><br></div><div>--</div><div>j.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 20, 2018 at 3:52 PM <<a href="mailto:peter@easthope.ca">peter@easthope.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In S3 this works.<br>
<br>
MODULE Test;<br>
IMPORT Oberon, Texts, TextFrames, Out, Viewers;<br>
VAR<br>
nameS: Texts.Scanner;<br>
PROCEDURE Test*;<br>
VAR<br>
v: Viewers.Viewer;<br>
BEGIN<br>
v := Oberon.MarkedViewer();<br>
Texts.OpenScanner(nameS, v.dsc(TextFrames.Frame).text, 0);<br>
Texts.Scan(nameS);<br>
Out.String("Marked viewer is named "); Out.String(nameS.s); Out.Char("."); Out.Ln<br>
END Test;<br>
BEGIN<br>
END Test.<br>
<br>
Mark the viewer and Test.Test *<br>
<br>
This is more succinct but gives the error "incompatible assignment". <br>
Edit.Locate leaves the caret after ().<br>
<br>
MODULE Test IN Oberon;<br>
IMPORT Oberon, Texts, TextFrames, Out, Viewers;<br>
VAR<br>
nameS: Texts.Scanner;<br>
PROCEDURE Test*;<br>
VAR<br>
v: Viewers.Viewer;<br>
BEGIN<br>
Texts.OpenScanner(nameS, Oberon.MarkedViewer().dsc(TextFrames.Frame).text, 0);<br>
Texts.Scan(nameS);<br>
Out.String("Marked viewer is named "); Out.String(nameS.s); Out.Char("."); Out.Ln<br>
END Test;<br>
BEGIN<br>
END Test.<br>
<br>
In the Oberon subsystem of A2, the preceeding compiles with no error.<br>
Anything interesting to learn from that?<br>
<br>
The (TextFrames.Frame) type cast seems a little devious.<br>
Can the result be accomplished without a type cast?<br>
<br>
Thanks, ... Lyall E.<br>
<br>
<br>
-- <br>
Message composed and transmitted by software designed to avoid the <br>
need, overhead and vulnerability of antivirus software.<br>
<br>
123456789 123456789 123456789 123456789 123456789 123456789 123456789<br>
Tel: +1 360 639 0202 +1 <br>
<a href="http://easthope.ca/Peter.html" rel="noreferrer" target="_blank">http://easthope.ca/Peter.html</a> Bcc: peter at easthope. ca<br>
--<br>
<a href="mailto:Oberon@lists.inf.ethz.ch" target="_blank">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br>
<a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" rel="noreferrer" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br>
</blockquote></div>