flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > question about calm documentation example |
Author |
|
Tomasz Grysztar 28 Mar 2023, 08:00
It sets up the default empty value, for when the MATCH fails, because in such case no value is assigned to "var" and "val", and therefore "val" keeps whatever value it had previously. You should see the difference with a sequence like:
Code: constdefine plus? +
constdefine test? |
|||
28 Mar 2023, 08:00 |
|
fabbel 28 Mar 2023, 08:18
Ok tx
I had vaguely thought about this, but defining empty symbolic constant seemed kinda pointless, so I was unsure ... ... could it then be rewritten as Code: calminstruction constdefine? var local val match var= val?, var publish var:, val end calminstruction constdefine plus? + as the doc says : (...) If a pattern in CALM instruction has a "?" character immediately following the name of a wildcard, it does not affect how the symbol is identified (whether the used symbol is case-insensitive depends on what is present in the local scope at the time the instruction is defined). Instead, modifying the name of a wildcard with "?" allows it to be matched with an empty text. (...) |
|||
28 Mar 2023, 08:18 |
|
fabbel 28 Mar 2023, 08:26
... actually I just tested it and it does not seem to be working ... I don't understand why though ...
|
|||
28 Mar 2023, 08:26 |
|
Tomasz Grysztar 28 Mar 2023, 09:20
That's because "= " is a hard requirement for whitespace, which cannot be fulfilled when at the end of line.
|
|||
28 Mar 2023, 09:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.