World: r3wp
[Core] Discuss core issues
older newer | first last |
Ingo 19-Feb-2008 [9246x2] | Sorry, just going nuts ... able-to-have-a-valus? or in short: valuable? |
valus? = value? of course ... | |
[unknown: 5] 19-Feb-2008 [9248x3] | I like valuable? |
Ingo, do I have your ok to submit your form of the valuable? function via Rambo? | |
Anyone know why the case function has a /all refinement? Seems the /all is what case does by default. | |
Ingo 19-Feb-2008 [9251x3] | Sure you have my OK. |
I see a difference ... >> case/all [1 probe 1 2 probe 2 3 probe 3 false probe false 5 probe 5] 1 2 3 5 == true >> case [1 probe 1 2 probe 2 3 probe 3 false probe false 5 probe 5] 1 == 1 | |
Bye, I'll leave for now. | |
[unknown: 5] 19-Feb-2008 [9254] | Yeah I am confused by the wording as it says for the /all: Evaluate all cases and for the function itself: Evaluates each condition That sounds the same. |
btiffin 19-Feb-2008 [9255x2] | case will normally stop after the first true condition. case/all will evaluate all of the true conditions. |
The key bit from the HELP is REFINEMENTS: /all -- Evaluate all cases (do not stop at first true case) | |
[unknown: 5] 19-Feb-2008 [9257x2] | Yeah I understand how it works but the help documentation seems confusing. |
would be nice to also break out of one of evaluated cases. | |
btiffin 19-Feb-2008 [9259] | There is always a REBOL way :) And after I post this, someone else will come by with the real answer. >> print catch [case/all [true [print 1] true [print 2] true [throw "4"] true [5]]] |
[unknown: 5] 19-Feb-2008 [9260x2] | that will work btiffin. |
That seems rather clean also. | |
Ingo 20-Feb-2008 [9262] | How about the following wording for case? Evaluates conditions until the first is true, then evaluates what follows it. |
[unknown: 5] 20-Feb-2008 [9263x5] | Makes it sound a bit like the first condition must be true. |
Evaluates each condition until true, then evaulates what follows it. | |
Then again that one makes it sound like all conditions must be true. | |
Evaulates conditions until a condition is true, then evaluates what follows it. | |
That sounds less confusing. | |
Ingo 20-Feb-2008 [9268x2] | Evaluates conditions until a condition is true, then evaluates the associated value. |
("what follows it" could be all the rest ...) | |
[unknown: 5] 20-Feb-2008 [9270] | So let me play newbie for a moment. If I see your phrase I might think that case is going to evaluate each condition until that condition is true and then evaluate what follows it. Similiar to an until function. |
Ingo 20-Feb-2008 [9271] | Evaluates the conditions, until the first true condition is found. Then evaluates the associated value. |
[unknown: 5] 20-Feb-2008 [9272x2] | Anyone have information on the STATS command. I'm trying to find some comprehensive information on it. I remember at one time there was a discussion regarding using stats to measure performance of functions, etc.. |
Not just memory usage. | |
btiffin 20-Feb-2008 [9274] | stats/evals is handy. Use it with stats/evals/clear And then look at rebol.org's mem-stats.r by Carl. It's not "comprehensive info" but it's info. :) |
Anton 20-Feb-2008 [9275] | I think "next value" is more precise than "associated value". |
[unknown: 5] 20-Feb-2008 [9276] | thanks Btiffin. I'll look for Carl's mem-stats.r function also. |
james_nak 22-Feb-2008 [9277] | I don't know where to put this question exactly but has anyone created any code to generate an Outlook appointment request? |
Gregg 22-Feb-2008 [9278] | I did some MAPI test R&D a long time back, though I think I wrapped it in a DLL to call from REBOL. Can you generate an iCal %.ICS file and do it that way? |
[unknown: 5] 22-Feb-2008 [9279] | The valuable?/potential? function would have to be updated. It needs to check for value. so it would be: valueable?: func [arg][found? all [any-word? :arg not lit-word? :arg value? :arg]] |
Rod 23-Feb-2008 [9280] | I am trying to pull some information out of a moderately formatted wiki and am tripping over something simple. I have grabbed what equates to a record in a table so far that looks as follows. ||Key 123||Description text||Status||02/23/08||Y|| I have parse giving me this as a block of values. Since this wiki is only loosely formatted the first field varies one line to the next, sometimes might just be Key, or *Key ###. What I am working too hard at is how to test a line is a pure Key ### value. I went looking using find for "Key "(with the space) values but that still picks up "*Key ###" values. I have multiple key types but generally it follows the pattern of trying to avoid the leading * lines and any line that isn't a known Key with some number following it. My old procedural habits would like a simple substring so I can test from the beginning for x number of characters. I have tried copy/part but am not getting the range syntax correct. I am also thinking I should just further split the field to the key+number so I can test that both parts exist and have appropriate values. Suggestions or nudges towards enlightenment? |
btiffin 23-Feb-2008 [9281x2] | Umm, I'll get this wrong; but parse is the ticket. nums: make bitset! [#"0" - #"9"] valid: parse value [ "Key" 3 nums] I think. |
space: make bitset! " " valid: parse/all value ["Key" space 3 nums space to end] Maybe? | |
Brock 23-Feb-2008 [9283x3] | I'd include a characterset that excludes the * character |
sorry bitset... nums: make bitset! [#"0" - #"9"] skip-char: complement make bitset! [#"*"] valid: parse value [skip-char "Key" " " 3 nums] | |
... something to that affect anyway. | |
Ingo 23-Feb-2008 [9286] | How about: nums: charset [#"0" - #"9"] space: charset [#" "] parse wiki ["||" any space "key" any space 3 nums any space "||" ] and so on ...] |
Rod 23-Feb-2008 [9287] | Brian, the first one seems to work for my test data, will give it a try on the real thing on Monday. Thanks all for the tips, will keep them handy as I refine this little script. |
Graham 23-Feb-2008 [9288] | Anyone got a clean-script that works with the new rebol syntax ? |
[unknown: 5] 23-Feb-2008 [9289] | Is there an easy way to remove double blocks from a block. So that something that looks like [[something]] looks like [something]? If not shouldn't we have something like this in REBOL as a mezz function? |
Henrik 23-Feb-2008 [9290x2] | this has been discussed before, but I think the solution has scrolled out of view a long time ago... |
R3 can do it using the new methods that loops can use, I believe. | |
[unknown: 5] 23-Feb-2008 [9292] | Are you saying it can't be done until R3? |
Henrik 23-Feb-2008 [9293x3] | it can easily be done. the simplest way is: |
form [[1][2][3]] | |
but it has limitations | |
older newer | first last |