English 中文(简体)
In Rebol How to get the Object Path Name (String)?
原标题:
  • 时间:2009-12-12 11:20:51
  •  标签:
  • rebol

Let s say I have

list: [system/history system/prompt]

I want to convert to

list-string: ["system/history" "system/prompt"]

This may be an obvious answer but I can t see any :)

Thanks.

问题回答

Or

>> list: [system/history system/prompt]
>> map-each v list [form v]
== ["system/history" "system/prompt"]

There s many simple ways to do this in Rebol. It s interesting to use parse:

>> list: [system/history system/prompt]
== [system/history system/prompt]
>> parse list [(list-string: copy []) some [set path path! (append list-string mold path)]]                                                                    
== true
>> list-string                                                                  
== ["system/history" "system/prompt"]

Another way, that updates the existing list block:

list: [system/history system/prompt]
== [system/history system/prompt]

forall list [list/1: mold list/1]

probe list
== ["system/history" "system/prompt"]

Assuming you never have spaces in the original list (as is true in your example)

parse form list none
== ["system/history" "system/prompt"]




相关问题
Rebol Email Pop Server error

I have tested pop successufully with some POP servers with Rebol but it doesn t work with my hosting server dreamhost (which works with Outlook I have tested http://wiki.dreamhost.com/Outlook_Express )...

Rebol and /local Object

The new function below doesn t work if Obj is local. If I remove it from /local it works. So what to do to make it work with a local Obj thanks ? Sure not hard for you. Person: make object! [ Person:...

In Rebol How to get the Object Path Name (String)?

Let s say I have list: [system/history system/prompt] I want to convert to list-string: ["system/history" "system/prompt"] This may be an obvious answer but I can t see any :) Thanks.

What new Widgets in Rebol 3 Vid? [closed]

Rebol 2 VID was hugely missing Dropdownlist and Treeview, I have made a search on Rebol 3 on Google but couldn t find anything except a discussion. So what will Rebol 3 VID really include as new ...

热门标签