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 [ | |
Author: "Toomas Vooglaid" | |
Date: 26-11-2017 | |
] | |
range: function [val1 val2 /step stp /limit /enbase ebase /debase dbase /unicode][ | |
stp+?: none | |
stp: any [stp either any [percent? val1 percent? val2] [1%][1]] | |
if any [all [block? stp zero? stp/3] zero? stp] [return none] | |
case [ | |
debase [ |
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 [ | |
Author: "Toomas Vooglaid" | |
Date: 2017-10-23 | |
] | |
context [ | |
A: B: C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z: none | |
numbers: make block! 10 | |
nums: make block! 10 | |
out: make block! 10 | |
letters: make block! 10 |
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 [ | |
Author: "Toomas Vooglaid" | |
Date: 2017-10-24 | |
Needs: View | |
] | |
context [ | |
system/view/auto-sync?: dragable?: off-the-post?: no | |
offset: pos-x: post: current-post: post1: post2: post3: disc: disc1: disc2: disc3: disc4: steps: thickness: none | |
post1-narrow: charset [ 48 - 52] | |
post2-narrow: charset [148 - 152] |
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: "Parse Info" | |
Purpose: { | |
Provides some stats about internal parse states usage for a given parsing job. | |
Could be used as a way to compare efficiency of different parsing strategies. | |
} | |
Date: 06-Oct-2017 | |
] | |
context [ |
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 [ | |
author: {Maxim Velesyuk} | |
usage: { | |
abc-score? <block of code> | |
abc-score? %file.red | |
abc-score? :some-function | |
} | |
description: { | |
The ABC software metric defines an ABC score as a triplet of values that represent the size of a set of source code statements. | |
An ABC score is calculated by counting the number of assignments (A), number of branches (B), and number of conditionals (C) in a program. |
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 [] | |
time: func [ | |
do-block | |
/repeat | |
n | |
/local | |
acc | |
start | |
][ |
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 Object Browser" | |
author: "Gregg Irwin" | |
needs: 'View | |
] | |
e.g.: :comment | |
map-ex: func [ | |
"Evaluates a function for all values in a series and returns the results." |
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: "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 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 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: { | |
Quick in-place function definitions without explicit arguments specification. | |
`_` is next arugment, `_N` is N-th argument | |
} | |
] | |
inc: func ['word] [set word 1 + get word] |
NewerOlder