Right thx Chris. That's the key. The code is now.
proc url {String} {
set data [url_help $String]
set result [concat \" [join $data " "] \"]
return $result}
proc url_help {String} {
package require http
package require tls
::http::register https 443 [list ::tls::socket -request 1 -ssl2 0 -ssl3 0 -tls1 1 -cafile VeriSignClass3SecureServerCA-G3.crt]
set token [::http::geturl $String]
upvar #0 $token state
return $state(body)}
I'm trying to return a string (code in red) and this works.
(bin) 3 % url "https://shenlanguage.org/TBoS/Programs/3.3.txt"
" (define factorial X -> (factorialh X 1)) (define factorialh 0 Accum -> Accum X Accum -> (factorialh (- X 1) (* X Accum))) (define plus X 0 -> X X Y -> (+ 1 (plus X (- Y 1)))) (define fib 0 -> 0 1 -> 1 X -> (+ (fib (- X 1)) (fib (- X 2)))) (define even? 1 -> false X -> (odd? (- X 1))) (define odd? 1 -> true X -> (even? (- X 1))) "
However if I try this on the Shen home page.
The #B6D4D1 is an RGB formatting instruction inside the HTML of the home page. It looks as if TCL/tk is somehow trying to act on it.
Mark