[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gm2 rejecting a constant statement as variable
From: |
Gaius Mulley |
Subject: |
Re: gm2 rejecting a constant statement as variable |
Date: |
Tue, 02 Apr 2024 11:35:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Alice Osako <alicetrillianosako@gmail.com> writes:
> Now, curiously enough, with the latest build for the compiler, the lines
>
> CONST
> BitsInUse =
> ORD(AddressableBits > MaxBits) * MaxBits +
> ORD(AddressableBits <= MaxBits) * AddressableBits;
>
> Still give the error:
>
> src/imp/Hash.mod:35:13: error: In implementation module ‘Hash’: in
> assignment, cannot assign a variable to a constant ‘BitsInUse’
> 35 | BitsInUse =
> | ^
> src/imp/Hash.mod:35:3: error: designator ‘BitsInUse’ is declared as a CONST
> 35 | BitsInUse =
>
> However, it works exactly as expected if written as:
>
> CONST
> BitsInUse = ORD(AddressableBits > MaxBits) * MaxBits +
> ORD(AddressableBits <= MaxBits) * AddressableBits;
interesting - what are the values (declarations) of MaxBits and
AddressableBits?
> Aside from the question of why this contradicts your earlier
> explanation, the problem of treating a constant assignment with a
> newline immediately after the equals sign as if there were a variable
> in the expression still persists, and seems to be independent of the
> constants issue.
Yes indeed I'll investigate.