This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [] | |
| lc: function [rule] [ | |
| parse rule [ | |
| some [ | |
| s: word! 'in skip | |
| (in: last reduce/into ['foreach s/1 s/3 make block! 4] in) | |
| | 'if skip | |
| (in: last reduce/into ['if to-paren s/2 make block! 4] in) | |
| | skip '| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Author: "Toomas Vooglaid" | |
| Date: 27-11-2017 | |
| ] | |
| lazy-range: function [ | |
| "Returns function that generates next value in (possibly infinite) range" | |
| val [scalar!] "Initial value" | |
| /step stp [scalar! block!] "By which to increment each next value" | |
| /limit lim [integer!] "How many new values to generate" | |
| /stop stopval [scalar! block!] "On which value to stop generation of new values; if block, then also after how may matches" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Author: "Toomas Vooglaid" | |
| Date: 26-11-2017 | |
| ] | |
| range: function [val1 val2 /step stp /limit /enbase ebase /debase dbase /unicode][ | |
| stp+?: none | |
| stp: any [stp either any [percent? val1 percent? val2] [1%][1]] | |
| if any [all [block? stp zero? stp/3] zero? stp] [return none] | |
| case [ | |
| debase [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Author: "Toomas Vooglaid" | |
| Date: 7-9-2017 | |
| Last-update: 4-10-2017 | |
| ] | |
| mx: context [ | |
| ctx: self | |
| mtx: object [ | |
| rows: cols: data: none | |
| get-col: func [col][extract at data col cols] |