World: r3wp
[Core] Discuss core issues
older newer | first last |
Ryan 27-Nov-2005 [2844x2] | Great! A case statement! I have been waiting for that! |
I like the functionality too. nice! | |
Ladislav 28-Nov-2005 [2846] | if you rename PIF to CASE (in the PIF source too), you hardly can find a difference |
Henrik 28-Nov-2005 [2847x3] | is there a way to use a function with a refinement as a word? |
something like: | |
do-a-function either condition ['ref][none] <arguments> as opposed to the clumsier: either condition [do-a-function/ref <arguments>][do-a-function <arguments>] | |
Volker 28-Nov-2005 [2850] | No good ways. You can build a path and do that. |
JaimeVargas 28-Nov-2005 [2851x3] | Dialect |
You can try multimethods.r | |
And have two singleton methods on the argument ref. | |
Volker 28-Nov-2005 [2854x2] | for own functions once i had an idea, but never really used: |
f: func[/a va /b vb /opts blk][ if opts[do bind blk 'opts] ?? a ?? b ] f/opts [a: 5] | |
Henrik 28-Nov-2005 [2856] | hmm... a bit confused about the BIND part... |
Volker 28-Nov-2005 [2857x4] | it binds the opts-blk to the locals. then you can set the locals from the caller. |
still confusing, but | |
ref-a: none val-a: "A" ref-b: true val-b: "B" f/opts [a: ref-a if ref-a[va: val-a] b: ref-b if ref-b[vb: val-b]] | |
but then it needs a composeto avoid name-clashes. maybe not the best idea. | |
Henrik 28-Nov-2005 [2861] | you lost me :-) but it's ok, I'll try something with build-path... |
Geomol 28-Nov-2005 [2862] | You can do this: do to-path reduce ['do-a-function either condition ['ref][none]] <argument> but if it's less clumpsy, you deside! |
BrianH 29-Nov-2005 [2863x2] | ; Try this way, no reduce or to-path... do either condition ['do-a-function/ref] [:do-a-function] <argument> |
; Or this do pick [do-a-function/ref do-a-function] condition <argument> | |
Gabriele 29-Nov-2005 [2865x2] | Graham: |
>> word: to lit-word! 'literal == 'literal >> parse [literal] [word] == true | |
Henrik 29-Nov-2005 [2867x2] | lots of different solutions to my problem... thanks everyone :-) |
a comment on ATTEMPT. I think it's a wonderful function, but don't overuse it because it can make your code hard to debug when nothing happens where there should be an error. | |
DideC 29-Nov-2005 [2869] | true |
Volker 29-Nov-2005 [2870] | i only use it for single calls. |
Anton 30-Nov-2005 [2871] | Steve, when it comes to SIXTH, I wouldn't worry too much. |
Graham 30-Nov-2005 [2872] | Is there a way to set and read windows environmental variables ? |
Pekr 30-Nov-2005 [2873] | 'get-env ? |
Graham 30-Nov-2005 [2874x3] | thanks. |
Does it work ? | |
works with "path" .. | |
Chris 30-Nov-2005 [2877x2] | env |
'scuse me... | |
Graham 30-Nov-2005 [2879] | Perhaps I need to reboot for rebol to pick up user env variables ? |
Gabriele 1-Dec-2005 [2880] | >> get-env "APPDATA" == {C:\Documents and Settings\Gabriele Santilli\Dati applicazioni} |
Graham 1-Dec-2005 [2881] | I had to reboot for this to work. |
Anton 2-Dec-2005 [2882x2] | You mean, you set a new user env variable, and rebol wasn't able to pick it up straight away ? |
logout and login probably sufficient | |
Graham 2-Dec-2005 [2884] | didn't try that ... |
RobertDumond 2-Dec-2005 [2885] | i'm running into a strange issue with the prerebolizer... it is taking a part of one line from my main rebol file and then a few blocks of another rebol file and overwriting another seemingly random rebol file with this data... has anyone run into this problem or have any idea what could be causing the problem? i am using Preprossor 2.0.0 |
Gregg 5-Dec-2005 [2886] | I haven't seen that Robert. Can you narrow it down to a very small example? |
Henrik 6-Dec-2005 [2887x2] | >> o: make object! [time: does [now]] >> third o == [time: func [][now]] >> reduce third o == [7-Dec-2005/3:23:23+1:00] >> third o == [time: 7-Dec-2005/3:23:23+1:00] >> o: make object! [time: does [now]] >> third o == [time: func [][now]] >> reduce copy/deep third o == [7-Dec-2005/3:25+1:00] >> third o == [time: 7-Dec-2005/3:25+1:00] Why is the block not copied? |
ah, using GET instead of THIRD allows me to copy it | |
Pekr 7-Dec-2005 [2889x3] | I have one question regarding security - can actually rebol words be secured/protected? I noticed, when looking at get-net-info and trying to execute it, that get-reg is probably being unset internally after get-net-info gets executed. Isn't it sign rebol's security model is not sufficient? |
I am not trying to say that we need modules, but I would like to know your opinion? Can some rebol word/value be really protected? We have 'unprotect available, so actually what is 'protect good for? | |
can I e.g. create word in context, which would be visible only in terms of such context? Being it value, function, whatever, prevented to be outputted by 'get, 'probe, 'print, 'source and other functions? | |
Gabriele 7-Dec-2005 [2892] | Henrik: what happens there is that the word TIME is set to the result of the function. |
Volker 7-Dec-2005 [2893] | AFAIK not. 'protect is for debugging AFAIK. But i can work secure if you use 'secure. The way is, as long as i dont touch user-data, i am secure. Thats why rebol has get-reg on startup, no user-code loaded, no harm possible. Before i touch user-code (or data), i tighten security as much as possible. unset dangerous words (if i am paranoid i disable "make struct!". I use secure to restrict file-access only where needed, disable shell and library, maybe network-access. A script/bug can not undo this things, and IMHO that is quite secure. |
older newer | first last |