Home   Archive   Permalink



How to mold into a long quoted string?

Is there any reason on R3:
    
>> path1: "123456789|123456789|123456789|123456789|123456789|123456789|"            
== {123456789|123456789|123456789|123456789|123456789|123456789|}
    
>> path1: "123456789|123456789|123456789|123456789|123456789|"            
== "123456789|123456789|123456789|123456789|123456789|"
    
How to transform the curly brackets into double quotes?

posted by:   OneArb     24-Oct-2023/15:37:11-7:00



both quotes and curly braces are a sign of a string (http://www.rebol.com/r3/docs/datatypes/string.html)
here is just the terminal output of rebol which does not change the data type.
If you need to change the behavior when entering data in the rebol terminal, then most likely you will have to change the source code

posted by:   Sergey_vl     24-Oct-2023/21:18:10-7:00



I am looking to output a string, length > 50, surrounded by double-quotes to an environment variable.
    
Just wondering what is the terse way of doing that.

posted by:   OneArb     25-Oct-2023/16:23:04-7:00



double-quote: {"}
export-string: rejoin [double-quote "your own long string here" double-quote]

posted by:   Arnold     26-Oct-2023/5:46:49-7:00



a: "123456789 123456789 123456789 123456789 123456789 123456789"
print rejoin [{"} a {"}]
// ------------ or -----------------
prin {"}
prin a
print {"}
    
can be try in http://rebol.scienceontheweb.net/

posted by:   Sergey_Vl     26-Oct-2023/7:37:20-7:00



Or use ^"
Print "^" 123...789 ^""

posted by:   Sergey_vl     26-Oct-2023/8:24:29-7:00



Would it make sense for to-local-file and clean-path to return quoted strings or at least have that option as paths with empty spaces require double quotes in Linux?


posted by:   OneArb     26-Oct-2023/14:32:03-7:00



single or double quotes

posted by:   OneArb     26-Oct-2023/16:12:58-7:00



No, the quotes are only in the MOLDed or PRINTed output, not in the internal STRING! that to-local-file and clean-path return.

posted by:   Kaj     26-Oct-2023/16:48:54-7:00



When you say Linux requires quotes, that is only in the shell. You may still need unquoted paths for Linux API calls.

posted by:   Kaj     26-Oct-2023/16:56:02-7:00



I'll add a little. If you need to work with variables in the shell, then you can use the "get-env" and "set-env" functions.
Quotes may also be required if the path to the file has spaces, then in Linux you can do so without quotes by placing a slash (\) in front of the space
localhost:~# mkdir "aaa bbb"
localhost:~# cd aaa\ bbb/
localhost:~/aaa bbb#

posted by:   Sergey_Vl     26-Oct-2023/18:44:16-7:00



Name:


Message:


Type the reverse of this captcha text: "e m i t y a D"



Home