First, thanks to everyone for taking time to read the proposal, do their own research, and offer suggestions. I don't know how to export messages from Gitter, so I'm afraid comments there may be lost to time. The REP is a wiki, so you can post your thoughts there. Wiki conversation isn't effective, but if we each have a comment section, we can put our interim and final thoughts there as we move forward. Or Peter can say if we would prefer to have people post things here for him to curate there.
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
opt: func [ | |
"If condition is TRUE, return value, otherwise return empty value of the same type" | |
condition | |
value "Some types, e.g., word types, return none if condition is false." | |
][ | |
either condition [ value ][ attempt [make value 0] ] | |
] | |
;opt true 'a | |
;opt true "A" |
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 [ | |
File: %greggs-mezz.red | |
Author: "Gregg Irwin" | |
Purpose: "An interim mezzanine dump, while Red is still moving fast." | |
Tabs: 4 | |
Comment: { | |
Not everything here has been well-tested or, well, tested. Most | |
of the functions are ports from R2, with many more to come. I'm | |
combining everything in one file for ease of experimentation, so | |
you don't have to worry about includes or dependencies with the |
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: "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. |
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: "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 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
; A number of languages have `take-while/drop-while` funcs. This is just to show how you | |
; can build them in Red. | |
; This model can be applied to any function that has a `/part` refinement, or extended in | |
; any number of ways. We don't yet have a standard `apply` or `refine` function in Red. | |
; Once we do, a more general HOF version could take the action as an arg, as well as the | |
; test to apply. | |
; Should this return the position, like FIND, rather than an integer? | |
; No match would then mean a NONE result. REMOVE/TAKE/COPY with /PART |
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
; It might seem like just a party trick, out of context. The goal is not "look how | |
; we can twist the language around!". Think, instead, of how you can use the language | |
; to most clearly express intent in different domains, or for different users. Quite | |
; often, when a user wants a different way to express things, we can accommodate them. | |
; It's also true that we can suggest a form that exists natively in Red, and they will | |
; be just as happy. | |
; | |
; Don't twist the language because you can. But don't be afraid to when it helps. | |
``` |
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: "Paint" | |
Author: [REBOL version "Frank Sievertsen" Red port "Gregg Irwin"] | |
File: %paint-with-time-travel.red | |
Tabs: 4 | |
Needs: View | |
version: 0.0.3 | |
Notes: { | |
The original didn't have time travel. |
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: "Gregg Irwin" | |
] | |
comment { | |
From Gitter, @this-gavagai asked about modeling in Red compared to modeling | |
in traditional OOP languages. Here's the concrete example given: | |
" | |
Imagine you wanted to simulate economic dynamics in a third world village. You |