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 [ | |
File: %greggs-mezz.red | |
Author: "Gregg Irwin" | |
Purpose: "An interim mezzanine dump, while Red is still moving fast." | |
Tabs: 4 | |
Comment: { | |
Not everything here has been well-tested or, well, tested. Most | |
of the functions are ports from R2, with many more to come. I'm | |
combining everything in one file for ease of experimentation, so | |
you don't have to worry about includes or dependencies with the |
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 [ | |
Needs: 'View | |
] | |
R: G: B: box: value: none | |
to-color: function [r g b][ | |
color: 0.0.0 | |
if r [color/1: to integer! 256 * r] | |
if g [color/2: to integer! 256 * g] |
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 O'clock" | |
Author: "Gregg Irwin" | |
] | |
degree-to-xy: func [rad "radius" deg "degrees"] [ | |
as-pair (rad * sine deg) (rad * negate cosine deg) | |
] | |
sex-to-degree: func ["Sexagesimal to degrees" n] [n * 6] |
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 [] | |
print [] | |
lc: function [block] [lc-state lc-rule input-rule filter-rule i e] [ | |
lc-state: make object! [ | |
do-block: copy [] | |
inputs: copy [] | |
filter-block: none | |
input-state: copy [] | |
res: copy [] | |
] |
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: "Nenad Rakocevic" | |
Date: 06/12/2013 | |
Note: { | |
This short Red program demonstrates the use of dynamically built Parse rules. | |
It parses an imaginary external DSL with variables, and detects if a variable has | |
been used before been properly declared and initialized. | |
The detection works by comparing found variables against a list of declared | |
variables. The list starts empty, and it grows as new variables are collected. |
NewerOlder