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" | |
file: "%regex.red" | |
Purpose: {Regex to parse converter} | |
History: {Started: 2017-05-09 | |
v.0.1: 2017-05-12 -- first working version with: | |
start `^^` and end `$` anchors, | |
non-capturing groups (one level) with alterns, | |
quantifiers (possessive), | |
some character-classes. |
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
Updated to Red for Windows version 0.6.2 built 7-Jun-2017/15:13:57+2:00 | |
The table gives type of first operand, type of second operand, result type | |
for + (add), - (subtract), * (multiply), / (divide), // (modulo) and % (remainder) | |
For vectors, the element type is distinguished. | |
There is one case (time with time) where the result type is not the same | |
for all allowed operations. | |
After each type combination, the reverse combination is given. | |
The fourth column gives the operators for which the combination is forbidden. | |
If the result type is error, the combination is forbidden for all operators. |
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: "Nsource - native source" | |
Purpose: "Print source for native functions" | |
Author: "Boleslav Březovský" | |
Date: "8-6-2017" | |
] | |
indent: func [ | |
"(Un)indent text by tab" | |
string [string!] "Text to (un)indent" |
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: "Dynamic View usage example" | |
Author: "Nenad Rakocevic" | |
Date: 08/07/2017 | |
] | |
generate: function [board [pair!] sz [pair!] return: [block!]][ | |
pane: make block! sz/x * sz/y | |
pos: 1x1 | |
count: 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 [ | |
author: { Maxim Velesyuk } | |
description: { | |
colors palette showcase | |
} | |
] | |
sys-words: words-of system/words | |
colors: copy [] | |
forall sys-words [ |
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: "Draw Image Resizing Test" | |
Author: [REBOL version "Carl Sassenrath" Red port "Gregg Irwin" Reacting version "Marco Antoniazzi"] | |
Version: 0.0.2 | |
File: %resize-image.red | |
Needs: View | |
] | |
img: load/as any [ | |
attempt [read/binary img-url: https://pbs.twimg.com/profile_images/501701094032941056/R-a4YJ5K.png] |
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 [] | |
let: func [ | |
binds | |
block | |
/local | |
ctx | |
][ | |
ctx: context append/only append binds copy [result: do] block | |
select ctx 'result |
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: %base32.red | |
date: 17-Sep-2015 | |
author: "Graham Chiu" | |
red-version: "Boleslav Březovský" | |
version: 0.0.3 | |
notes: { | |
encodes string to base32 or base32hex | |
padding to 5 characters is not required in this method | |
>> to-base32/decode/hex to-base32/hex "yessir" |
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
reverse: func [ | |
series /skip size /part length /local i tuple | |
][ | |
switch type?/word series [ | |
pair! [return to-pair reduce [series/2 series/1]] | |
tuple! [tuple: clear [] repeat i length? series [append tuple pick series i] series: copy tuple tuple: yes] | |
] | |
size: any [size 1] | |
either 0 = ((length? series) % size) [ | |
length: any [length length? 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
Red[] | |
reduce+: func [ | |
"Reduce with unset!, error! -> none! conversion" | |
block | |
/local value new-block | |
][ | |
new-block: block | |
collect [ | |
until [ |