gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] Issue with rename a function & compiler crash


From: Gaius Mulley
Subject: Re: [Gm2] Issue with rename a function & compiler crash
Date: Sat, 10 Mar 2018 13:50:38 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Michael Riedl <address@hidden> writes:

> Hallo Gaius,
>
> many thanks for the new version. Most compiler crashes I had before
> are gone - only one is left.
>
> Collected the necessary files in the attached tar file (it's the
> module Differ.mod).
>
> And one small hurdle is the renaming of functions, see
> TestRename.mod. In my view a legal construct
>
> COST CABS = LongComplexMath.abs;
>
> (or similar) does not work.
>
> Will do further tests (especially multidimensional arrays) and report.
>
>
> Michael

Hi Michael,

many thanks for testing and the feedback.  Yes I had seen this in your
code, it is a very interesting usage.  Currently the compiler does not
handle this - but it could be changed - I see that it could be useful.

Separately to the above, I'd just like to clarify that this is ISO M2 legal?

MODULE test ;

CONST
   foo = bar ;

PROCEDURE bar (ch: CHAR) : CHAR ;
BEGIN
   RETURN CAP (ch)
END bar ;

VAR
   ch: CHAR ;
BEGIN
   ch := foo ('a')
END test.

I think this is so as the standard document p229 note 1 and 2 says:

1.  A value designator that denotes a function procedure is either a
procedure identifier of a function procedure heading (possibly qualified
by the name or names of modules from which the procedure identifier is
exported), a value designator that denotes a constant that has a
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function procedure value, or a value designator that denotes a variable
^^^^^^^^^^^^^^^^^^^^^^^^
that has a function procedure type.

2.  The identifiers of predefined procedures are not value designators
since predefined procedures are not values that can be assigned,
compared in expressions or passed as procedure parameters.

assuming that my understanding is correct - I'll work on a fix,

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]