This file contains 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
divisible?: func [a b] [0 = remainder a b] | |
; This doesn't work like R3 in how negative widths work. | |
forskip: func [ | |
"Evaluates a block at regular intervals in a series." | |
'word [word!] "Word referring to the series to traverse (modified)" | |
width [integer!] "Interval size (width of each skip)" | |
body [block!] "Body to evaluate at each position" | |
/local orig result op | |
][ |
This file contains 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
; This doesn't work like R3 in how negative widths work. | |
forskip: func [ | |
"Evaluates a block at regular intervals in a series." | |
'word [word!] "Word referring to the series to traverse (modified)" | |
width [integer!] "Interval size (width of each skip)" | |
body [block!] "Body to evaluate at each position" | |
/local orig result op | |
][ | |
either zero? width [none] [ | |
; TBD: assert word refs series |
This file contains 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: "Scheduler" | |
File: %scheduler.r | |
Purpose: "Dialected task scheduling library" | |
Author: ["SOFTINNOV / Nenad Rakocevic" "Pointillistic / Gregg Irwin"] | |
Copyright: ["2009 SOFTINNOV" "2013 SOFTINNOV/POINTILLISTIC"] | |
Email: [[email protected] [email protected]] | |
Date: 28-Oct-2013 | |
Version: 0.9.5 | |
License: "BSD - see %LICENCE.txt file" |
This file contains 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
*I tried to eliminate all my local words* | |
# Most important | |
abs ; just an alias | |
apply ; But, PLEASE, a better way to propagate refinements | |
array ; I rarely use this myself | |
assert | |
build-markup ; More general interpolation this is built on | |
build-tag ; Need tag! first |
This file contains 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
map-each: function [ | |
"Evaluates body for each value(s) in a series, returning all results." | |
'word [word! block!] "Word, or words, to set on each iteration" | |
data [series! map!] | |
body [block!] | |
] [ | |
collect [ | |
foreach :word data [ | |
if not unset? set/any 'tmp do body [keep/only :tmp] | |
] |
This file contains 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
;-- In %natives.reds | |
checksum*: func [ | |
check? [logic!] | |
_tcp [integer!] | |
_hash [integer!] | |
_method [integer!] | |
_key [integer!] | |
/local | |
arg [red-value!] |
This file contains 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 [] | |
; Steeve gets credit for this one | |
detab: function [ | |
"Converts leading tabs in a string to spaces. (tab size 4)" | |
string [any-string!] "(modified)" | |
/size | |
sz [integer!] "Number of spaces per tab" | |
/all "Change all, not just leading" | |
][ |
This file contains 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 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" | |
File: %analog-clock.red | |
Tabs: 4 | |
Needs: View | |
Purpose: { | |
- Introduce some basic Red concepts, like functions and datatypes | |
- Show how the DRAW block and timer events work in the View system | |
} |
This file contains 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: "Bubbles" | |
Author: [REBOL version "Gabriele Santilli" Red port "Gregg Irwin"] | |
File: %bubbles.red | |
Tabs: 4 | |
Needs: View | |
] | |
system/view/auto-sync?: no |
OlderNewer