World: r3wp
[Core] Discuss core issues
older newer | first last |
Cyphre 14-Jan-2005 [269] | C to Rebol is very simmilar...have to leave now...bye for now |
shadwolf 14-Jan-2005 [270x8] | bye and thank you cyphre for your contribution to thi discution. |
it was a very good source of information | |
and kwoledge | |
knowledge sorry :) | |
well now i know better how to handle REBOL -> C and C-> REBOL the idéal thing could be a convert-reb-to-c multi type, multi size native! function in Command and in REbol/view Pro (I think it will be added to core any way than accessible if you have the licence.key file) | |
maybe idela convertion function could be c_convert/int ma_var with ma_var : [ 1 4 5 10 ] if c_convert workon a REBOL array then no need to specify manually the length we retrieve the info using lenght? type could be treat as rafinement and a switch could branch into c_convert function the adapted tranlation algorithm | |
improving this c_convert for int64 for example could be a very easy task ;) | |
to avoid to rewrite X time the same lind of code we just in the switch premaid a countainer adapter to the data we want to handle. | |
Terry 15-Jan-2005 [278x2] | Has anything changed with core regarding loading? I'm trying to load a function using a URL, and it comes back as a block? |
Has load become load/all ? | |
Sunanda 15-Jan-2005 [280] | For anything other than a simple value, you've always got a block back from load (as far as I remember) >> load "1" == 1 --- a value >> load "1 2" == [1 2] --- a block >> load mold :to-idate == [func ..... -- a block >> |
Terry 15-Jan-2005 [281] | ic.. here's another .. how can i determine if a 'word has been set yet, in the code? |
Sunanda 15-Jan-2005 [282] | >> value? 'xx == false >> xx: 1 == 1 >> value? xx == true |
Terry 15-Jan-2005 [283x2] | what if i dont want to spin the value? is there no way to check other than trying it? |
or wait.. nvm :) | |
Sunanda 15-Jan-2005 [285] | Value? 'xx shouldn't "do" anything with the word being tested-- so it should be safe at all times Or am I missing your point? >> xx: func [] [print "hello"] >> value 'xx >> value? 'xx == true -- does not print "hello" |
Terry 15-Jan-2005 [286] | no, I read your post too quickly |
Geomol 19-Jan-2005 [287] | I often wonder, why 'while' takes a condition-block, when 'if' doesn't. Is there an explanation for that? |
Ladislav 19-Jan-2005 [288] | of course. The IF condition is evaluated once, while WHILE condition may be evaluated many times. |
Gabriele 19-Jan-2005 [289] | Geomol, if you try to write your implementation of WHILE, you'll immediately see the reason. :) |
Geomol 19-Jan-2005 [290] | Thanks! :-) |
Ashley 20-Jan-2005 [291] | Given that we have a 'read-net func, would a 'write-net equivalent make sense? (could then have a [view] 'request-upload func to match 'request-download) |
Geomol 22-Jan-2005 [292] | Did I just found an error with replace? Try these: >> replace/all "abc{def" "{" "^^{" == "abc^^{def" >> replace/all "abc{def" "{" "^{" == "abc{def" So I can't get a result with just one ^? |
Volker 22-Jan-2005 [293] | ^^^{ ? a "^{" is the same as a "{". To allow {this ^{ is a paren} . |
Geomol 22-Jan-2005 [294] | >> replace/all "abc{def" "{" "^^^{" == "abc^^{def" |
Volker 22-Jan-2005 [295x2] | Yes thats right. Its molded. "^" is escaped, the escape-char is "^".. |
print replace/all "abc{def" "{" "^^^{" | |
Geomol 22-Jan-2005 [297x4] | yes, seems right |
The result is 8 bytes. | |
But s: {this ^{ is a paren} gives an error: ** Syntax Error: Invalid string | |
>> s: "this ^{ is a paren" works ok. | |
Volker 22-Jan-2005 [301] | works on 1.2.48.4.2 . what are you using? |
Geomol 23-Jan-2005 [302x3] | 1.2.57.3.1 |
I'm trying to build a string with rebol content inside (also strings). And I get into trouble. I think, it's a bug. Try this: >> s: "^"abc^/def^}ghi^"" == {"abc def^}ghi"} >> to-block s ** Syntax Error: Invalid string -- "abc ** Near: (line 1) "abc | |
This works: >> s: "^"abc^"" == {"abc"} >> to-block s == ["abc"] so my example above should work too, right? | |
Sunanda 23-Jan-2005 [305] | Looks like to-block isn't noticing the carat: >> to-block "^{}" == [""] >> to-block "^{" ** Syntax Error: Invalid string -- { ** Near: (line 1) { |
Geomol 23-Jan-2005 [306x3] | I don't think, you can have a block with only a '{' inside. REBOL will think of it as the start of a string. If you put '{' in between "", you don't have to use caret, but you can: >> to-block "^{^}" == [""] >> to-block "{}" == [""] I think, my problem start, when I have a newline before a '{': >> to-block "^"^/{^"" ** Syntax Error: Invalid string -- " ** Near: (line 1) " |
Because this works: >> to-block "^"{^"" == ["{"] | |
I figure, the problem is with strings, not with to-block or any other command. | |
[unknown: 5] 23-Jan-2005 [309] | Probably because the caret can be used even in strings and used for line termination formatting etc.. |
Geomol 23-Jan-2005 [310] | I would be ok with reporting this to RAMBO, but would like to be sure, it's a bug first. (I don't like too much in RAMBO, if it's not a bug anyway.) |
Anton 24-Jan-2005 [311] | Can you give an example of your input and final desired output ? |
Geomol 24-Jan-2005 [312x3] | Input: |
Input: "^"^/{^"" That's a string with 4 bytes: A ", then a newline, a { and another ". Operation: to-block Desired output: ["^/{"] That's a block with a string, that consists of 2 bytes: a newline and a {. If this can be solved, then I can solve my other problems, I think. (Same goes with } btw.) | |
Maybe it's easier to see, if I use binary: >> b: #{220A7B22} ; That's my input string as binary. Try these: >> to-string b >> to-block b The last one will fail, but it should give me: == ["^/{"] | |
sqlab 24-Jan-2005 [315x3] | >> s: input ^/{ == {"^^/^{"} >> to-block s == ["^/{"] >> print s ^/{ >> print to-block s { >> |
Is that what you want? | |
I guess as soon as you have a newline in your string you should start the string with { and not with " | |
Geomol 24-Jan-2005 [318] | Interesting! |
older newer | first last |