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: "AWK in REBOL" | |
File: %rawk.r | |
Author: "Gregg Irwin" | |
Version: 0.0.8 | |
Comment: { | |
Inspired by AWK. The core design is very appealing to me: a data | |
driven app that processes text files automatically iterating over | |
files and lines, and splitting lines up into fields. I don't care | |
for much of the AWK syntax, though, so I'm not shooting for |
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: "Grep in REBOL" | |
File: %rgrep.r | |
Author: "Gregg Irwin" | |
Version: 0.0.2 | |
Comment: { | |
rgrep searches one or more input files for lines containing a match | |
to a specified pattern. Refinements on EXEC are a shot at familiar | |
switches used with GREP. Not sure if we need them, though /quiet does | |
allow a nice optimization as we can break out on the first match. |
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: "Spline demo" | |
Author: "Xie Qingtian, Nenad Rakocevic" | |
File: %spline.red | |
Needs: 'View | |
Date: "22/06/2016" | |
License: "MIT" | |
Notes: { | |
This simple spline tool allows you to drag the control points position | |
using the mouse, and see the spline's shape change accordingly. |
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
; Stats added by @toomasv | |
compare-times: func [ | |
blocks "Block of code blocks to performance compare" | |
/count ct | |
/local t n baseline res blk stats1 memory time code template | |
][ | |
ct: any [ct 1] | |
t: now/time/precise | |
loop ct [do []] | |
baseline: now/time/precise - t |
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 [] | |
view [ | |
style calc-btn: button 34x28 | |
style fn-btn: calc-btn | |
style fn-btn*: calc-btn font-name "Symbol" | |
style num-btn: calc-btn white | |
across | |
space 4x4 |
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 [] | |
; TBD - how to handle an unspecified end value? What to return for it? | |
; 4.. 12- | |
; Should time! values be taken as time ranges or should 3:5 be | |
; the same as [3 to 5]? | |
; Should we take a series value so we can get the length of it, | |
; or should we return a special token for the caller to apply? | |
; What about multiple range specs? [1..4 6..9 12..15] | |
; What about other separators |
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: "Simple news scroller" | |
Author: "@pekr, updated by Gregg Irwin" | |
] | |
;system/view/auto-sync?: no | |
screen-size: system/view/screens/1/size | |
news-bottom-offset: 0x100 | |
news-height: 0x100 |
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 [] | |
e.g.: :comment | |
delta-time: function [ | |
"Return the time it takes to evaluate a block" | |
code [block! word! function!] "Code to evaluate" | |
/count ct "Eval the code this many times, rather than once" | |
][ | |
ct: any [ct 1] |
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: [@greggirwin @endo @toomasv @hiiamboris] | |
Purpose: "COMPOSE for strings" | |
Notes: { | |
TBD: Security model for eval'ing expressions | |
TBD: Decide if support for custom marker and eval contexts are worthwhile | |
TBD: Finalize refinement names | |
TBD: Decide if suport for function contexts is worthwhile | |
TBD: Make it a macro? | |
TBD: Decide if file and url params should be read automatically |