World: r3wp
[Core] Discuss core issues
older newer | first last |
Gregg 14-Dec-2006 [6448] | And with that number of objects, if you can use blocks instead of objects, it will reduce the weight even more. |
Maxim 14-Dec-2006 [6449] | but notice he is creating faces... can't replace that with block ! |
Rebolek 14-Dec-2006 [6450] | it's possible to replace it with block, when you create draw dialect instead of pane of faces |
Gregg 14-Dec-2006 [6451x3] | Right, to clarify, if your my-face object has other overhead that could be externalized, do that, and use blocks that contain a reference to the lightest-weight face you can use. |
Yes, even better rebolek. | |
It's exciting to see someone pushing REBOL this way though! | |
Rebolek 14-Dec-2006 [6454] | placing bitmaps with draw is possible even in non-AGG versions of View |
Maxim 14-Dec-2006 [6455] | do you think such a big draw block will hold? |
Rebolek 14-Dec-2006 [6456] | hm, not sure, but you can have one face per line (or column - don't know which direction Jerrry uses :) filled with draw block |
Maxim 14-Dec-2006 [6457] | well, I guess it depends on exactly what he is outputting... but by what I understand, the display is less an issue than the actual loading of all the characters. |
Rebolek 14-Dec-2006 [6458x2] | if he's just loading characters then keeping images in block is definitely better |
you can have block like this: [unicode-number image! unicode-number image! ...] and then just use SELECT | |
Maxim 14-Dec-2006 [6460] | yep. |
Jerry 14-Dec-2006 [6461] | Thank you for all your comments. I'll try them out. |
Graham 16-Dec-2006 [6462] | How about a /native refinement to return files in 'request-file to return files in the native file format? |
Anton 17-Dec-2006 [6463] | Why not just write a TO-LOCAL-FILES function to do that for all files in a block ? |
Graham 17-Dec-2006 [6464x4] | because it means I could do this |
show-text field form any [ request-file/only/native copy "" ] | |
and not get "none" in the field | |
umm.. let me rephrase that! | |
Anton 17-Dec-2006 [6468] | >> form to-local-file any [%hello %""] == "hello" >> form to-local-file any [#[none] %""] == "" |
Graham 17-Dec-2006 [6469x3] | form any [ to-local-file request-file/only/native copy "" ] |
form any [ to-local-file request-file/only copy "" ] | |
which errors if request-file returns none | |
Anton 17-Dec-2006 [6472] | This doesn't: form to-local-file any [request-file/only %""] |
Graham 17-Dec-2006 [6473] | ahh.. :) |
Anton 17-Dec-2006 [6474] | Too easy, eh ? |
Graham 17-Dec-2006 [6475] | yeah .. but I think it would be good to still have the switch as it reduces the work. |
Anton 17-Dec-2006 [6476] | mmm... I'm not convinced. |
Graham 17-Dec-2006 [6477] | it's a switch to control what is being returned by a function |
Chris 18-Dec-2006 [6478x3] | I'd like an inverse of the 'case function. It goes through conditions and evaluates the associated block if the condition is *false*. The following does what I need: inverse-case: func [conditions [block!] /local test][ while [not tail? conditions][ set [test conditions] do/next conditions either test [ conditions: next conditions ][ return do first conditions ] ] return test ] Any pitfalls with this approach? Also, any naming suggestions? I was thinking 'assert or 'assert-all. |
Example: | |
assert [ exists? %rebol.exe [make error! "rebol.exe does not exist"] 0 < size? %rebol.exe [make error! "rebol.exe is empty"] ] | |
Graham 18-Dec-2006 [6481x4] | 0 < (size? %rebol.exe) |
I don't even have a feeling for assert | |
so, this is just case, with not in front of each condition? | |
so, why not just call it .. not-case ? | |
Chris 18-Dec-2006 [6485] | I guess it's to do with usage: though it functions like 'case, it is more like 'all with a step-by-step fallback. |
Anton 19-Dec-2006 [6486] | Mmm.. yes, I've needed that kind of expression sometimes. |
Gabriele 19-Dec-2006 [6487x4] | graham, the paren is not needed there. |
chris: a trick i have seen: | |
if not all [ msg: "rebol.exe does not exist" exists? %rebol.exe msg: "rebol.exe is empty" 0 < size? %rebol.exe ] [make error! msg] | |
anyway, assert seems a good name to me. | |
Anton 19-Dec-2006 [6491] | Gabriele, yes I've used this trick, but it's a little uncomfortable. |
Dirk 21-Dec-2006 [6492] | Hi, syntax question: i want to insert a row into a mysql db: string-block: [ "value1" "value2" insert db [ "insert into table values (?,?)" string-block ] this fails (string-block is not evaluated i guess), but i dont know how to generate the following insert db [ "insert into table values (?,?)" "value1" "value2" ] (which works) using rejoin, remold, join, .. whatever. |
Maxim 21-Dec-2006 [6493] | merrry christmas :-) insert db compose [ "insert into table values (?,?)" (string-block) ] |
Dirk 21-Dec-2006 [6494x2] | and happy xmas to you! this works! how to factor out the "insert into .." string into a variable? stmt: "insert into .." insert db compose [ stmt (vals) ] does not work, neither does insert db reduce [ stmt vals ] which puzzles me ... |
btw. is this the right place to ask? | |
Maxim 21-Dec-2006 [6496x2] | this is the right place indeed :-) like so? insert db reduce compose [ stmt (vals) ] == ["insert into .." "value1" "value2" ] |
in REBOL since string datatypes evalutate to themselves, the result of the compose (which removes the outer block) will simply stay where they are . | |
older newer | first last |