World: r3wp
[!REBOL3-OLD1]
older newer | first last |
Ladislav 18-Sep-2006 [1480] | no, because in the case I am programming a control function I do not want to force the users to specify the destination just because they are using my control function |
BrianH 18-Sep-2006 [1481] | There are function attributes to prevent a function from catching a return or throw, should there be one for break? |
Ladislav 18-Sep-2006 [1482] | no, because this is a loop business, function attributes cannot help |
Anton 18-Sep-2006 [1483x2] | I understand. That sounds like the way to go. |
what do you mean by "the WHILE cycle" though ? | |
BrianH 18-Sep-2006 [1485] | For that matter, I thought the point to runing a block of code with a loop 1 was to catch breaks. Can you rebreak? |
Ladislav 18-Sep-2006 [1486] | while: native [ {While a condition block is TRUE, evaluates another block.} cond-block [block!] body-block [block!] /throw {pass along break} ] |
Anton 18-Sep-2006 [1487x2] | Do you mean you could write: while/throw user-cond-blk user-code |
No, I think Ladislav just used loop 1 as an example of any of the looping control structs. | |
BrianH 18-Sep-2006 [1489] | Sounds good to me Ladislav. Add it to the other loop functions too. |
Ladislav 18-Sep-2006 [1490] | For that matter, I thought the point to runing a block of code with a loop 1 was to catch breaks. - sorry for my oversimplification, I didn't mean to use *only* 1 |
BrianH 18-Sep-2006 [1491] | Sorry for the misspellings in that comment too :) |
Ladislav 18-Sep-2006 [1492x2] | Add it to the other loop functions too. - this is a "higher level" business and I will be content with having at least WHILE/THROW. I guess, that it will not be used frequently (?) |
Moreover, it looks to me, that we are able to "simulate" such a construct using PARSE in REBOL2 | |
BrianH 18-Sep-2006 [1494] | If you add /throw to while, it should at least be added to the other native looping functions. I will be used if it is there, and being consistent is easier than explaining the lack of consistency over and over again. |
Ladislav 18-Sep-2006 [1495] | OK, I will ty to convince Carl to add it to REBOL 3 |
BrianH 18-Sep-2006 [1496] | The only thing I would be wary of is that every low-level refinement you add is one more either statement if you want to pass the refinement along from the mezannines. Has Carl figured out how to deal with that structural problem in the REBOL language? |
Ladislav 18-Sep-2006 [1497x2] | just a side note: it looks, that we will get CONTINUE in REBOL 3 too and I suppose the /THROW to "pass along" CONTINUE too |
regarding the structural problem: we should convince Carl to give us a comfortable APPLY function, shouldn't we? | |
BrianH 18-Sep-2006 [1499] | That is my favorite part of rebcode, by far. |
Ladislav 18-Sep-2006 [1500x2] | :-) |
so, I guess that it would be nice if you found a spec for APPLY that would be able to handle refinements in some way | |
BrianH 18-Sep-2006 [1502] | The APPLY in rebcode handles refinements just fine. |
Ladislav 18-Sep-2006 [1503] | (need to check that, didn't use rebcode for quite some time) |
BrianH 18-Sep-2006 [1504] | I used it quite a bit. You remember how much I posted in the rebcode group :) |
Ladislav 18-Sep-2006 [1505x2] | yes |
actually I wrote Rebcode test suite but am not sure how thoroughly I tested APPLY | |
Pekr 18-Sep-2006 [1507] | I hope rebcode is integral part of R3, although some guys were concerned about security (not being able to crash rebol by faulty rebcode code) |
BrianH 18-Sep-2006 [1508] | APPLY would take refinements as positional arguments. That meant you would need to match the order of refinements in the declaration of the function you are calling, and that your function call would break if the function changed the order of its arguments - fragile. For some reason APPLY was slow too, and would crash REBOL if run too many times in a rebcode function. |
Ladislav 18-Sep-2006 [1509x2] | ah, really? can you supply code for that? |
function call would break if the function changed the order of its arguments - fragile I am afraid, that it is hard to find a less fragile spec, though | |
BrianH 18-Sep-2006 [1511x3] | Look back on the rebcode group. It was a standing problem. I was more concerned about it being slow as dirt though - the instability was likely to get fixed, but the slowness may be structural. |
Can you get from a refinement to the word it is based on? Are refinements bound? | |
If so, you could pass along the refinements as keyword arguments in a REBOL version of APPLY. | |
Ladislav 18-Sep-2006 [1514] | Are refinements bound? - refinements are not bound usually |
BrianH 18-Sep-2006 [1515] | Oh well, there goes one idea for a less fragile interface. |
Ladislav 18-Sep-2006 [1516] | ...but if you write f: func [/a] [/a 'a], then the /a refinement isn't bound, but the 'a *is* |
BrianH 18-Sep-2006 [1517x2] | But if you write a: none apply :f [/a] then the apply function can't tell that it should be passing the /a refinement as none. |
If /a is not bound, I mean. | |
Ladislav 18-Sep-2006 [1519x2] | right, you would need to write apply :f [/a a] |
(or something similar) | |
BrianH 18-Sep-2006 [1521] | Not bad really, but slower than positional arguments I suppose. |
Ladislav 18-Sep-2006 [1522] | highly probable |
Maxim 21-Sep-2006 [1523x2] | Regarding R3 tasks... |
Will any thread be able to kill the main process? or are we stuck like with python? | |
Gabriele 21-Sep-2006 [1525] | hmm, that depends on a lot of things. i'd say yes, but otoh there may be cases where that is not a good idea. it's to early to say anything about that, anyway. |
Dockimbel 21-Sep-2006 [1526] | Gab, do you know if R3 threads are soft or native threads ? |
Gabriele 21-Sep-2006 [1527x2] | native, at least that was the idea. |
personally i somewhat prefer soft, but native has the advantage of making use of multiprocessor machines. | |
Maxim 21-Sep-2006 [1529] | I agree... and with dual cores becoming increasingly main stream... there is a definite advantage in that. |
older newer | first last |