<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>FYI: <br>
</p>
<p>I thought a little bit more about your answer and decided to try
it with my Stanford compiler; <br>
in fact, your pointer parameter is a VALUE parameter, and because
it is copied into the procedure's<br>
local stack, it should be treated much like a local variable IMO,
and there it is indeed possible to use <br>
the ^basetype notation and all the other type notations, too.
Therefore IMO it should also be possible <br>
to define new types with value parameters, be it useful or not.
The normal Pascal assignment <br>
rules apply (parameter passing to value parameters is much like
normal assignment, with some <br>
tolerance regarding types). <br>
</p>
<p>So I decided to allow it, but for value parameters only. For var
and const parameter, different rules<br>
apply, because there we have conformant strings for example
(strings without length) etc.; <br>
so I call a different parsing function, when I have a var or const
keyword. Without var or const, <br>
I call the same parsing function for types which I call in var
declarations etc, too. <br>
</p>
<p>So now the following program compiles (and runs) without problem:
<br>
<br>
</p>
<p><tt>program TESTPTR ( OUTPUT ) ;</tt><tt><br>
</tt><tt><br>
</tt><tt>//**********************************************************************</tt><tt><br>
</tt><tt>//$A+
</tt><tt><br>
</tt><tt>//**********************************************************************</tt><tt><br>
</tt><tt><br>
</tt><tt>type CFORW = record</tt><tt><br>
</tt><tt> SOMEV : INTEGER ;</tt><tt><br>
</tt><tt> C : -> CHAIN ;</tt><tt><br>
</tt><tt> end ;</tt><tt><br>
</tt><tt> CHAIN = record</tt><tt><br>
</tt><tt> N : INTEGER ;</tt><tt><br>
</tt><tt> NEXT : -> CHAIN ;</tt><tt><br>
</tt><tt> end ;</tt><tt><br>
</tt><tt><br>
</tt><tt>var K : -> CHAIN ;</tt><tt><br>
</tt><tt> X : CFORW ;</tt><tt><br>
</tt><tt><br>
</tt><tt>procedure PRINT ( X : -> CHAIN ) ;</tt><tt><br>
</tt><tt><br>
</tt><tt> begin (* PRINT *)</tt><tt><br>
</tt><tt> while X <> NIL do</tt><tt><br>
</tt><tt> begin</tt><tt><br>
</tt><tt> WRITELN ( X -> . N ) ;</tt><tt><br>
</tt><tt> X := X -> . NEXT</tt><tt><br>
</tt><tt> end (* while *)</tt><tt><br>
</tt><tt> end (* PRINT *) ;</tt><tt><br>
</tt><tt><br>
</tt><tt>begin (* HAUPTPROGRAMM *)</tt><tt><br>
</tt><tt> NEW ( K ) ;</tt><tt><br>
</tt><tt> X . C := K ;</tt><tt><br>
</tt><tt> K -> . N := 1 ;</tt><tt><br>
</tt><tt> NEW ( K -> . NEXT ) ;</tt><tt><br>
</tt><tt> K := K -> . NEXT ;</tt><tt><br>
</tt><tt> K -> . N := 2 ;</tt><tt><br>
</tt><tt> NEW ( K -> . NEXT ) ;</tt><tt><br>
</tt><tt> K := K -> . NEXT ;</tt><tt><br>
</tt><tt> K -> . N := 3 ;</tt><tt><br>
</tt><tt> K -> . NEXT := NIL ;</tt><tt><br>
</tt><tt> PRINT ( X . C ) ;</tt><tt><br>
</tt><tt>end (* HAUPTPROGRAMM *) .</tt><br>
</p>
<p><br>
- I use a different notation for the pointer symbol; ^ is
possible, too <br>
</p>
<p>- there is no declaration for the -> CHAIN pointer type,
nowhere <br>
</p>
<p>- it is even possible to use it in the CFORW record, prior to the
definition of CHAIN <br>
(those forward references are checked later) <br>
</p>
<p>Kind regards <br>
</p>
<p>Bernd <br>
<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 10.06.2019 um 03:26 schrieb Ben
Grasset:<br>
</div>
<blockquote type="cite"
cite="mid:CAL4d7FiX=e0cjQwUspGnP87Kn-MU62SrX3Aa4VNM=Yp0mQT5rQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_quote">
<div>
<div class="gmail_quote"><br>
<div>
<div dir="ltr">On Sun, Jun 9, 2019 at 8:37 PM Bernd
Oppolzer <<a
href="mailto:bernd.oppolzer@t-online.de"
moz-do-not-send="true">bernd.oppolzer@t-online.de</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<div
class="gmail-m_-6623500855074377321moz-cite-prefix">I
am still not sure, if it is a good idea, because
this would be an exception for pointer types; <br>
other type constructors like arrays, records,
enumerations etc. are still not supported ... <br>
and it does not make sense IMO to support them. </div>
</div>
</blockquote>
<div><br>
</div>
<div> People keep saying this as though the <b>entire
concept </b>of adding even the smallest new thing
syntactically to FPC is a completely new idea (which
it obviously is not.)</div>
<div>Adding this would <b>not </b>be any kind of
notable "exception" in any practical sense, unless
you're holding FPC to a purely fictional standard
for Pascal </div>
<div>that it does not actually currently follow in
reality.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>