api2021 part I #5

Merged
tomasz.sowa merged 5 commits from api2021 into master 2021-05-27 10:41:17 +02:00
Owner

merge some work from api2021 branch:

  • changed semantic of [def] statements
  • updated to the new pikotools api
merge some work from api2021 branch: - changed semantic of [def] statements - updated to the new pikotools api
tomasz.sowa added 5 commits 2021-05-27 10:41:10 +02:00
0ac8e05c04 changed semantic of [def] statements:
- [def] is used to define a variable (like before)
  but if we assign a string such as [def var "string"] the string is evaluated to bool
  in a different way: empty string is false, not empty string is true
- added [def?] statement - similar like [def] but define a variable only if such
  a variable is not already defined
- added [let] statement - similar like [def] but with lazy evaluation (it is an alias to a function)
  if it is called to assign a string e.g. [let var "string"] then this has the
  same meaning like [def] - an alias is only created when we assign a function e.g. [let var my_function]
  both [def] and [let] are using the same Vars object
- added [let?] - make an alias but only if such a variable is not already defined
- a std::map of variables moved outside of Generator
  added method void SetVariables(Vars & variables);
- fixed: a result status was not correctly propagated when evaluating [def] statements,
  this was in Call(...) function: last_res from variables was set in Find()
  but later was overwritten by Call(...) called for parameters (recursively)
tomasz.sowa merged commit 0bcaca4770 into master 2021-05-27 10:41:17 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tomasz.sowa/ezc#5
No description provided.