user310291
user310291

Reputation: 38180

Red or Rebol: how to convert "test/a" to [test/a]

I tried to do this:

 b: []
 append b  to-word "test/a"

but it generates error

* Syntax Error: invalid character in: "test/a" * Where: to *** Stack: run to-word

Upvotes: 1

Views: 118

Answers (3)

Dave Andersen
Dave Andersen

Reputation: 5447

You can use a lit-path!, but by default the path will be split:

>> append [] 'test/a
== [test a]

Unless you use the /only refinement:

>> append/only [] 'test/a
== [test/a]

This assumes Red. I'm not sure if it's the same in Rebol.

Upvotes: 2

Graham Chiu
Graham Chiu

Reputation: 4886

>> append b: copy [] to path! "test/a"
== [test/a]

Upvotes: 3

Jacob Good1
Jacob Good1

Reputation: 176

;for 30 characters

to block! "test/a"

Upvotes: 5

Related Questions