Table of Contents
A lit-path! value is an unevaluated (quoted) path! value.
A lit-path! value will decay into a path! value when evaluated, such as when entered into the Red REPL.
Lit-path! is a member of the following typesets: any-block!, any-path!, series!
Lit-path values can be created using quote and literal syntax, or at runtime by using a make constructor or to conversion.
>> 'foo/bar/baz
== foo/bar/baz
>> type? 'foo/bar/baz
== path!>> quote 'foo/bar/baz
== 'foo/bar/baz
>> type? quote 'foo/bar/baz
== lit-path!>> make lit-path! [foo bar baz]
== 'foo/bar/baz>> to lit-path! [foo bar baz]
== 'foo/bar/bazYou can create an empty lit-path of a given size by supplying an integer value as an argument to make:
>> make lit-path! 10
== 'BNF:
<lit-path-literal> ::= '<path-literal>
<path-literal> ::= <path-head>/<selector>
<path-head> ::= <word-literal> | <path-literal>
<selector> ::= <integer> | <word-literal> | :<word-literal> | <paren>Parse:
lit-path: [lit-word! some selector]
selector: [#"/" [integer! | word! | get-word! | paren!]]Use lit-path? to check if a value is of the lit-path! datatype.
>> lit-path? first ['foo/bar]
== true
>> lit-path? quote 'foo/bar
== trueUse type? to return the datatype of a given value.
>> type? first ['foo/bar]
== lit-path!
>> type? quote 'foo/bar
== lit-path!