World: r3wp
[Core] Discuss core issues
older newer | first last |
Izkata 27-May-2009 [13882] | >> i: 0 a: func [z][i: i + 1 a 1] a 1 == 1704 >> i: 0 a: func [z y][i: i + 1 a 1 2] a 1 2 == 1706 >> i: 0 a: func [z y x][i: i + 1 a 1 2 3] a 1 2 3 == 1705 |
Steeve 27-May-2009 [13883x2] | One stack for calls, one other for parameters perhaps |
all is possible | |
Maxim 27-May-2009 [13885] | possibly the stack includes a single payload block for calls... this would make sense, in preventing stack depth variance. |
Steeve 27-May-2009 [13886] | meaning parameters are not stored in the call stack :) |
BrianH 27-May-2009 [13887x2] | Carl would not be using GCC for Win builds, because REBOL is older than the short time period that GCC has been good on Windows |
It would also depend on platform-specific stack handling. | |
Maxim 27-May-2009 [13889x4] | possibly, yes, by indirection. push stack [func args-block] and args-block is a mem copy of the args block with local values |
this is all speculation though... hehehe | |
what I am surprised overall is that rebol does not simply increase stack space. isn't that possible in current OSes? | |
I mean, the interpreter, dynamically. | |
BrianH 27-May-2009 [13893] | Function argument stacks are handled in function-specific value frame stacks in R2. They are stored in stack frames in R3, which changed the stack allocation to be more task-safe and have faster function calls. |
Steeve 27-May-2009 [13894] | Brian, i would be very suprised. Rebol uses his own way to handle stacks, if not it would be unportable. |
Maxim 27-May-2009 [13895] | I think that last post from brian wasn't speculation... I think he actualy knows, being in the R3 internal loop ;-) |
Steeve 27-May-2009 [13896] | i mean it's not platform specific. |
BrianH 27-May-2009 [13897x2] | This is one aspect of the internals that I actually am aware of, since it affects contexts. It's true: REBOL implements its own stacks, and doesn't use the C stack to call REBOL functions, just natives. |
The platform-specific aspect could be affected by page and/or pointer alignment. | |
Steeve 27-May-2009 [13899] | well, it an easy deduction, if not Rebol could not be portable |
BrianH 27-May-2009 [13900] | REBOL is not fully portable. The platform-specific parts are wrapped in APIs internally. |
Steeve 27-May-2009 [13901x2] | yes but the VM need to be fully portable |
the core engine must be | |
BrianH 27-May-2009 [13903] | This is why the R3 host code is separate, and will be open-sourced. The host code is non-portable. The VM can call API functions provided by the host code. This would be necessary for a variety of reasons, not the least of which is that memory management, tasking, networking, any number of things are implemented by different platforms differently. |
Henrik 29-May-2009 [13904] | http://www.openldap.org/lists/openldap-devel/200304/msg00123.html Anyone made a REBOL version of this? It's a UTF-8 <-> ISO-8859-1 converter in C. |
Maxim 29-May-2009 [13905] | hasn't peterwood just uploaded a pretty nice string en/decoder on rebol.org? |
Henrik 29-May-2009 [13906] | will check |
Sunanda 30-May-2009 [13907] | Peter's code detects the encoding, and can do several comversion between encoding types: http://www.rebol.org/view-script.r?script=str-enc-utils.r |
Henrik 30-May-2009 [13908] | wow, very nice. thanks. |
Maxim 30-May-2009 [13909x2] | used on rebol.org I suppose ? :-) |
peterwood can I make a wish? I really need a function which can detect if a file is binary or text... do you think its possible to have such capabilities in your module? | |
Sunanda 30-May-2009 [13911] | I have a printable? function that checks if a string has only ASCII printable characters. Would that meed your need, Maxim? |
Maxim 30-May-2009 [13912] | its already very usefull, its for detection of how to process files in distro-bot. right now it just treats any non rebol script as a binary, but I'd like to add some processing to other text files. maybe peter can extend the concept and figure out if there are only printable characters in other encodings :-) |
amacleod 6-Jun-2009 [13913] | just "discovered" 'alter' fuction...very handy |
Sunanda 7-Jun-2009 [13914] | Sadly, 'alter has not made it into R3: http://www.rebol.net/r3blogs/0124.html |
Graham 7-Jun-2009 [13915x4] | Doesn't seem a very suitable name for what it does ... |
How about 'swap instead ? | |
>> flags: [] == [] >> swap flags 'resize == true >> flags == [resize] >> swap flags 'maximize == true >> flags == [resize maximize] >> swap flags 'resize == false >> flags == [maximize] | |
Does it read better than 'alter ? | |
Sunanda 7-Jun-2009 [13919] | 'alter was always a poor choice of name -- short for 'alternate apparently, but too short to be obvious. Anton has suggested 'toggle as a better name for it. |
Graham 7-Jun-2009 [13920x3] | toggle implies something is always there ... but in a different state. Swap is to imply that something goes in and out :) |
Rotate is another possibility | |
Never had the need to use this word though :) | |
Henrik 7-Jun-2009 [13923] | I've used ALTER once for user selection in a list, and it was even a special case. I think having the ability to just conditionally append to a block if the value does not exist is more useful. I.e. an ALTER, split in two functions. |
Graham 7-Jun-2009 [13924x2] | Trying to think of where I could use this function ... |
>> a: [ b b c d ] == [b b c d] >> alter a 'b == false >> a == [b c d] | |
Sunanda 7-Jun-2009 [13926] | 'alter is a hard one to name. The operation is: * if the target value exists in the series: remove the first instance of it * if it does not exist in the series: append it to the end. The "remove first instance" makes it more generic than rotate/swap/toggle when there is more than one instance of the target in the series. |
Chris 7-Jun-2009 [13927] | flag/deflag ? |
Sunanda 7-Jun-2009 [13928] | 'cull almost works :-) An english defintion being: "To take someone or something (from somewhere)." |
Chris 7-Jun-2009 [13929] | 'cull would be a great name for 'remove-each : ) cull deer herd [deer = not smart] |
BrianH 7-Jun-2009 [13930x2] | ALTER is still in R3, though its usefulness is so limited it may be moved to R3/Plus. The enhanced logic flags that were supposed to replace it were removed in the latest release - they were never refined or documented to the point of being useful. |
In theory, ALTER is a set function, so the series in question is not supposed to have duplicates. | |
older newer | first last |