It would be great if it would be possible to use (global) variables. Similar to less these could be prefixed by '@'. So that a variable gets global, it should first be used in global space. Example (similar to #77, but rather extending it):
/* initialize variable @list with an empty list, making it global */
@list: list();
/* process all peaks ordered by elevation downward */
node[natural=peak]:order-numerical-desc(ele) {
/* to @list append the name of the current map feature */
@list: append(@list, tag("name"));
}
/* print current @list to stderr, which should be the names of all peaks
* in current bounding box, ordered by elevation downward */
debug(@list);
The following things need to be implemented:
How to do?
- save block of global statements as if they are a normal rule
- compile as a function similar to check_X, execute from main loop with list of other objects
It would be great if it would be possible to use (global) variables. Similar to less these could be prefixed by '@'. So that a variable gets global, it should first be used in global space. Example (similar to #77, but rather extending it):
The following things need to be implemented:
debug()in the last row).How to do?