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: "Red-Updater-Script" | |
File: %red-updater.r | |
Author: "Neelesh Chandola, @nc-x" | |
Description: { | |
This Script updates your Red Installation with the latest master-branch binaries. | |
} | |
Instructions: { | |
Please update the variable `path-to-red-executable` with appropriate | |
location of the Red executable on your system before running the script. |
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: "FORSKIP function" | |
Author: "Nenad Rakocevic" | |
Purpose: "Direct port of the REBOL2 forskip function" | |
] | |
forskip: func [ | |
"Evaluates a block for periodic values in a series." | |
'word [word!] "Word set to each position in series and changed as a result" | |
skip-num [integer!] "Number of values to skip each time" |
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: "Currency converter" | |
Author: ["Mark Summerfield" "Nenad Rakocevic"] | |
License: ["Apache 2.0" http://www.apache.org/licenses/LICENSE-2.0] | |
Version: 1.0.0 | |
Needs: 'View | |
] | |
converter: context [ | |
currencies: rates: usd: gbp: from: target: value: list: pos: e: none |
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
; 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 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
;-- In %natives.reds | |
checksum*: func [ | |
check? [logic!] | |
_tcp [integer!] | |
_hash [integer!] | |
_method [integer!] | |
_key [integer!] | |
/local | |
arg [red-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 [] | |
; 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 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
invalid-utf?: function [ | |
; https://robots.thoughtbot.com/fight-back-utf-8-invalid-byte-sequences | |
"Checks UTF encoding; if correct, returns none else position of error." | |
binary [binary!] | |
][ | |
bad: [ | |
#{C0} | #{C1} | #{F5} | #{F6} | #{F7} | #{F8} | #{F9} | #{FA} | |
| #{FB} | #{FC} | #{FD} | #{FE} | #{FF} | |
] | |
if parse binary [any [[mark: bad (return mark)] | skip]] [none] |
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: "trig-lab.red" | |
Author: "Gregg Irwin" | |
File: %trig-lab.red | |
Needs: 'View | |
Purpose: { | |
See %math-lab comments for details. This script focuses | |
on trigonometric functions. | |
} | |
] |
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: "math-lab.red" | |
Author: "Gregg Irwin" | |
File: %math-lab.red | |
Needs: 'View | |
Purpose: { | |
Experiment, to see what an interactive "Lab" tool might look | |
like, for general language functions. i.e., take the idea of | |
font-lab, effect-lab, gradient-lab, etc., and apply it to | |
functions to aid in language discovery and learning. |
NewerOlder