Skip to content

Instantly share code, notes, and snippets.

@GiuseppeChillemi
GiuseppeChillemi / Collect-Function
Last active January 30, 2024 02:42
Collect-Functions
Red [
title: "collect-functions"
description: "collects all the function names found inside a block (statically and not at runtime)"
]
add-function: func [
"Append the function name to the target container"
container [block!] "The container of functions"
name [word! set-word! lit-word! paren!] "The function to add or the paren that will be reduced to the name"
/index "Adds the path to reach the function from the top"
@GiuseppeChillemi
GiuseppeChillemi / for-record.red
Last active January 22, 2024 02:54
For-Skip attemp
Red [
title: "For-Record"
description: "A For-skip alternative"
notes: {
Use BREAK-HERE let the function return the series at current position
Use RETURN-VALUE to let the function return anything you want
If the cycle will end naturally, the series will be at head position
}
]
@GiuseppeChillemi
GiuseppeChillemi / set-caret-test.red
Created October 18, 2023 22:38
Set-Caret does not work
Red [
title: "NoteManager Evolution"
needs: 'View
]
#system [
#import [
"user32.dll" stdcall [
SendMessage: "SendMessageW" [
@GiuseppeChillemi
GiuseppeChillemi / test-vid-not-enough-mememory.red
Created September 26, 2023 23:08
Bug on multiple clicks with take and insert on head
Red [
Title: "This is a bug test for with"
Description: "it generates not enough memmory"
]
;
;#include %scripts-rebol/add-word.red
;#include %scripts-rebol/get-start-end.red
;#include %scripts-rebol/select-and-store2.red
@GiuseppeChillemi
GiuseppeChillemi / TUI-tests-merged.red
Created September 14, 2023 17:49
A script which hangs the event system
Red [
Title: "Red TUI merged test script"
Needs: 'View
Config: [GUI-engine: 'terminal]
Description: {
show an hang on the event system
}
]
page-3: layout/tight [
@GiuseppeChillemi
GiuseppeChillemi / speedtest-key-val2.r
Last active September 4, 2023 22:03
Speed test for various key/val structures
;Red []
Rebol [
Title: "Speed test key val2"
purpose: "Evaluate which method and structures are better for key-val selection"
Notes: {Actually supports Rebol3 and Red}
Todo: {
debug r3 for slowness
debug r3 for error on saving
create a text questions standard with "ask",choices,menu-map
add integer validation
@GiuseppeChillemi
GiuseppeChillemi / speedtest-key-val.r
Last active September 1, 2023 18:28
Testing key-value speeds
Red [
Title: "Speed test key val"
purpose: "Evaluate which method and structures are better for key-val selection"
note: "It has some bugs, don't use it but speedtest-key-val2."
]
recycle/off
;=== Setup
test: copy []
top: 1000000
## Questions on SPACES paths
Please answer with yes/or no
| | Stored as block? | Stored as name + size block? | Stored as path? | Stored as tree path? | Visualized as path? | Visualized as tree path? | returned as path by functions? | returned as tree path by functions? |
| ----------------------------------- | ---------------- | ---------------------------- | --------------- | -------------------- | ------------------- | ------------------------ | ------------------------------ | ----------------------------------- |
| /map facet | | | | | | | | |
| /parent facet | | | | | | |
This code:
view [
host [
vlist [
bt: button "Press meee I am space!"
gr: grid-view source= table-data2 size 400x300 on-created [probe gr save %new-mold.txt gr]
with [
@GiuseppeChillemi
GiuseppeChillemi / testing-find-methods.r
Last active August 23, 2022 17:05
Testing the speed of various methods
;Red []
Rebol []
find**: func [
data
column
value
/local
container
out-data