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 [ | |
| Title: "BMR (Basal Metabolic Rate) Calculator" | |
| Author: "Gregg Irwin" | |
| File: %bmr-calc.red | |
| Needs: View | |
| Comment: { | |
| An experiment in reactivity and data modeling. | |
| TBD: Caloric calcs based on activity level. |
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 [ | |
| Title: "BMR (Basal Metabolic Rate) Calculator" | |
| Author: "Gregg Irwin" | |
| File: %bmr-calc.red | |
| Needs: View | |
| Comment: { | |
| An experiment in reactivity and data modeling. | |
| TBD: Caloric calcs based on activity level. |
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
| REBOL [ | |
| Title: "VB Like Operator Module" | |
| Date: 10-Sep-2003 | |
| Version: 0.0.3 | |
| File: %like.r | |
| Author: "Gregg Irwin" | |
| Purpose: { | |
| The LIKE? function is a first crack at something like | |
| VB's Like operator. i.e. a *very* simple RegEx engine. The | |
| real purpose was to help me get acquainted with parse. |
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 [ | |
| title: "Red Pretty Printer" | |
| notes: "Derived from http://www.rebol.net/cookbook/recipes/0042.html" | |
| ] | |
| output: none ; output text | |
| indent: copy "" ; indentation chars | |
| emit-val: func [val] [append output val] |
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 [] | |
| cycler: context [ | |
| _data: none | |
| _key: none | |
| set-data: func [data [block!]][ | |
| _data: copy data | |
| ; Should we make sure the data conforms to our needs? | |
| ;if (last data) <> (first data) [ | |
| append/only _data first _data |
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 [] | |
| closure: func [ | |
| vars [block!] "Values to close over, in spec block format" | |
| spec [block!] "Function spec for closure func" | |
| body [block!] "Body of closure func; vars will be available" | |
| ][ | |
| func spec bind body context vars | |
| ] | |
| cycler: func [block [block!]][ |
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 [] | |
| load-any: function [input [string!]][ | |
| out: make block! 100 | |
| junk: none | |
| until [ | |
| result: load/trap/next input 'pos | |
| either error? result/3 [ | |
| append any [junk junk: make string! 20] result/2/1 |
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 [] | |
| form-all: func [blk][forall blk [blk/1: form blk/1] blk] | |
| types-of: function [value [typeset!]][ | |
| ; typesets don't support reflection | |
| third load mold value | |
| ] | |
| get-sys-words: func [test [function!]][ |
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 [] | |
| form-all: func [blk][ | |
| forall blk [blk/1: form blk/1] | |
| blk | |
| ] | |
| types-of: function [value [typeset!]][ | |
| ; typesets don't support reflection | |
| third load mold value |
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 [] | |
| a-or-b: function [a b][any reduce [a b]] | |
| |: make op! :a-or-b | |
| example: { | |
| >> a-or-b: function [a b][any reduce [a b]] | |
| == func [a b][any reduce [a b]] | |
| >> |: make op! :a-or-b | |
| == make op! [[a b]] |