Skip to content

Instantly share code, notes, and snippets.

flatten: func [
"Remove new-line markers from block, paren or hash"
blk [any-list!]
/deep "remove the markers also from sub-blocks etc."
][
new-line/all blk off
if deep [
forall blk [
if block? blk/1 [flatten/deep blk/1]
]
Red [
Title: "Data structure information for Red inspector"
]
;---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; construct the structures table consisting of pairs of
; structure name (alias struct!) and block of entries [field name]
; the header field is not stored as it is the same for every structure
Red [
Title: "Red value slot implementation dump for Red inspector"
]
;---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; auxiliary functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Red [
Title: "Red value inspector"
Author: "Rudolf W. MEIJER"
File: %value-inspector.red
Rights: {Copyright (c) Rudolf W. Meijer 2018}
Purpose: {To expose implementation information}
Comment: {This program shows, for a given Red value, the implementation
at hardware memory level; it is aware of the various Red/System
structures that implement value slots, and of the storage
schemes for series values, symbols, and contexts.}
REBOL [
Title: "Red Lexical Scanner"
Author: "Nenad Rakocevic"
File: %lexer.r
Tabs: 4
Rights: "Copyright (C) 2011-2015 Nenad Rakocevic. All rights reserved."
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt"
Comments: {Adapted by Rudolf W. Meijer for making the Red concordance.
This involves parsing Red, Red/System and REBOL programs by one lexer.
The changes are:
REBOL [
Title: "Red concordance program"
Name: "concordance"
File: %red-concordance.r
Author: "Rudolf W. Meijer"
Rights: "Copyright (C) 2015-2018 Rudolf W. MEIJER. All Rights Reserved"
Needs: [2.7.6]
@meijeru
meijeru / count-code-lines.r
Last active January 23, 2018 12:01
Count the number of lines of code in the Red source files
Rebol []
red-source: %/C/Users/Eigenaar/Projects/Red/sources/ ; adapt this for your situation
output-sources: %sources.txt
version: read red-source/version.r
vdate: modified? red-source/version.r
nl: "^/"
@meijeru
meijeru / arith.txt
Last active September 6, 2017 15:36
Types of artihmetic operations
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.
@meijeru
meijeru / %docstring-missing.txt
Created May 13, 2017 15:19
Functions with missing docstring
<<
>>
>>>
as-color
as-ipv4
as-rgba
ask
bind
charset
comment
@meijeru
meijeru / split-url.red
Last active May 8, 2017 21:46
Split a url! value into components
Red [
Title: "URL splitter"
Purpose: {split a url into its compoments}
Author: "Rudolf W. MEIJER"
File: %split-url.red
Version: 0.2.0
Date: "02-Apr-2017"
Rights: "Copyright (c) Rudolf W. MEIJER"
History: [
[0.0.0 "25-Mar-2017" {Start of project}]