Created
September 3, 2018 14:56
-
-
Save nedzadarek/177b33cc11fade1e2ec6070ae9ad1e62 to your computer and use it in GitHub Desktop.
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: "Nędza Darek" | |
license: "point to this gist/github" | |
] | |
get-with-paren: function [:word [word! path! paren!]] [ | |
case [ | |
word? word [ | |
get get :word | |
] | |
path? word [ | |
get get :word | |
] | |
paren? word [ | |
do reduce [head insert back tail word 'get] | |
] | |
] | |
] | |
a: 'b | |
b: 42 | |
get-with-paren a | |
p: 'arr/foo/baz | |
arr: [foo [baz 111]] | |
get-with-paren p | |
arr2: [a [1 2] b [3 4]] | |
p2: 'arr2/b | |
get-with-paren (remove next p2) | |
arr2; == [a [1 2] b [3]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment