World: r3wp
[!REBOL3-OLD1]
older newer | first last |
[unknown: 5] 21-Jan-2009 [9854x3] | I can already do something like this: fnc: func [a [unset! string!]][either value? 'a [a][a: "I got value"]] |
but it would nice to be able to do something like this: fnc: func[a [string!] /default $10 ][print a] fnc >> $10 | |
where anything after /default is a default value for the respective parameter. | |
BrianH 21-Jan-2009 [9857] | Note that your parameter was the last in the list, the second condition mentioned above. That would only work if the calling expression was the last in its block because of REBOL's evaluation rules. |
[unknown: 5] 21-Jan-2009 [9858] | Which is even more reason why the second example would be preferred. |
BrianH 21-Jan-2009 [9859] | The evaluation rules of REBOL can't change without requiring parentheses or something around function arguments. |
[unknown: 5] 21-Jan-2009 [9860] | I didn't know how deep changes were being made with respect to R3. Maybe a wish for R4. |
BrianH 21-Jan-2009 [9861] | Default values for parameters that are not the last parameter would need to be made optional using refinements. You *really* can't change this, not even in R4. |
[unknown: 5] 21-Jan-2009 [9862] | Seems odd to me. What language is REBOL written in? |
BrianH 21-Jan-2009 [9863] | C and REBOL, with some C++ in linked libraries (AGG). |
[unknown: 5] 21-Jan-2009 [9864] | Then it is doable from that standpoint - must be another reason that it wouldn't be done. |
BrianH 21-Jan-2009 [9865] | It has nothing to do with the implementation language though - it's a syntax thing. |
[unknown: 5] 21-Jan-2009 [9866x2] | In C++ for example the defaults are set as follows: int fnc (int x = 1 int y = 2){...} |
I can understand the syntax issue from the perspective of it requiring the parameters defaults be ordered. | |
BrianH 21-Jan-2009 [9868] | Languages that wrap function arguments in parentheses (like C and Pascal) or are line-oriented (like Basic and Python) or at least have statement separators (like ; ) have a way of telling where their argument lists end. REBOL can only do so if the arity of a function is determinable at the call site. This is the price we pay for getting rid of the parentheses. |
[unknown: 5] 21-Jan-2009 [9869] | Yeah, I wish Carl would give more specifics on the internals sometime. |
BrianH 21-Jan-2009 [9870] | That is not a matter of internals, it really is a consequence of REBOL's evaluation rules. You can't change it without changing the language in drastically incompatible and slower ways. |
Steeve 21-Jan-2009 [9871] | Ok, i made a demo using the virtual block scheme (tested only with the last alpha) Sorry for my frenglish http://www.MegaShare.com/573256 |
Oldes 21-Jan-2009 [9872] | Why you use such a site instead of using for example rebol.org? |
Henrik 21-Jan-2009 [9873] | it's small. |
Steeve 21-Jan-2009 [9874x3] | the scheme size 4,5 Kb, i add documentation, so now it's huge 10 Kb |
Oldes, it's a first try, then i will post it in rebol.org | |
and i have no ftp currently T_T | |
Henrik 21-Jan-2009 [9877] | Steeve, why does CLEAR clear the whole block? |
[unknown: 5] 21-Jan-2009 [9878x2] | Don't see nothing there but ads. Steeve, if you want something quick you can use mediafire.com |
www.mediafire.com | |
Steeve 21-Jan-2009 [9880] | because there is now way to delete one or several records currently |
Henrik 21-Jan-2009 [9881] | Steeve, ah, forgot that. |
[unknown: 5] 21-Jan-2009 [9882] | Try that link above - it is good. |
Henrik 21-Jan-2009 [9883] | Paul, try reloading the page a few times. It worked here. |
[unknown: 5] 21-Jan-2009 [9884] | I had to put on compatibility mode but got it. |
Henrik 21-Jan-2009 [9885] | (but I agree those sites generally suck) |
Steeve 21-Jan-2009 [9886] | T_T |
[unknown: 5] 21-Jan-2009 [9887x2] | I'm not sure I'm doing something right as I got an error. Let me look thru the script. |
Oh this requires R3 - duh. I can't try this out yet. | |
Steeve 21-Jan-2009 [9889] | uhuh T_T |
[unknown: 5] 21-Jan-2009 [9890] | I'll check it out in a few months. ;-) |
Henrik 21-Jan-2009 [9891] | Steeve, so the basic limitations now are natives that don't support ports? |
Steeve 21-Jan-2009 [9892x4] | it seems |
you can call the actor with his full path anyway, but' it's not rebolish | |
the main objective it to allow programers, to switch between normal blocks and virtual blocks when they want without the need to rewrite their code | |
brb (shower time) | |
BrianH 21-Jan-2009 [9896x3] | Watch out: R3 currently doesn't support documentation or anything other than whitespace (if that) before the REBOL header. Yes, it's a bug. You will need to remove the docmentation from the beginning of the script for this to run. |
Steeve, I notice that there are several comments that start with BUG! or MISSING! - I expect to see CureCode tickets for each of these :) | |
Unless you would prefer I write them. | |
Steeve 21-Jan-2009 [9899x2] | Brian, it's strange i can run the script as-is |
Brian write them please i'm a bit lazy with that bugs. | |
BrianH 21-Jan-2009 [9901x2] | Really? That's new. I'll test that and mark the associated ticket as tested if so :) |
That was a comment on 2 messages past. | |
Will 21-Jan-2009 [9903] | ot, Brian: could you have Carl build a 2.7.7 alpha/beta with all the work you have done? shouldn't take much time for him 8) |
older newer | first last |