World: r3wp
[Core] Discuss core issues
older newer | first last |
shadwolf 14-Jan-2005 [253] | yes it helps me a lot |
Cyphre 14-Jan-2005 [254] | so you can see everything is possible to do (except the callbacks ;)) |
shadwolf 14-Jan-2005 [255] | to figure out in simle example this looks easy .... (hum not a lot in fact beacaus all the science is done by int-to-array reebol function witch is not pretty accessible to common or mortals ) |
Cyphre 14-Jan-2005 [256x3] | maybe one improvemet would be great for us: |
have some faster way how to construct those binary! data from Rebol | |
I hope this could solve the REBIN feature or else we need some another native functionality for that | |
Gabriele 14-Jan-2005 [259x2] | you could makje it faster by reusing the same struct instead of creating a new one on each iteration |
that would avoid a reduce too | |
shadwolf 14-Jan-2005 [261x3] | and if y have twenty array sized and typed different kind for my external lib I will need to wirte and handle as many function to play with binary content |
Cyphre you comming to my main point ;) giving to carl a premaid function that allow us to deal easyly with array (int, float, char what ever type) but for struct based array that's a challenge too and an horrible task to do | |
example: struct my-struct { int a[10], char *name, other-struct ptr-ostruct[20];} | |
Cyphre 14-Jan-2005 [264] | yes Gabriele this could help too....I wrote this function as a quick one so it can be optimized for sure |
shadwolf 14-Jan-2005 [265] | in the current way to handle you need to be very sharp to can interact with it from rebol and that why Cyphre you have all my admiration for your quick made AGG external exploitation script ... |
Cyphre 14-Jan-2005 [266] | shadwolf: I think you only need to write one global function which will convert you rebol block of chosen datatype into binary! form...this way you can pass any content to C side... |
shadwolf 14-Jan-2005 [267] | that's the REBOLTo C way but how about the C to rebol way (that I provide using the MD2 file example) |
Cyphre 14-Jan-2005 [268x2] | As I said it is not so hard when yog get more experience...I spent hours when started to use DLLs from rebol. I had also bad luck I wanted to use very badly designed DLL in my first project so this was even bigger pain for me ;) |
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 [302] | 1.2.57.3.1 |
older newer | first last |