World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
alemar 18-Jan-2011 [4185x2] | bulgaria |
it`s barely 22:30 but i got a lot to do tommorow | |
Pekr 18-Jan-2011 [4187] | I am from Czech Republic .... |
alemar 18-Jan-2011 [4188] | :D |
Maxim 18-Jan-2011 [4189] | and when its needed, you can force input types: fixed a few typos... this should work right: my-func: func [value /optional opt-value [string!] ] [ probe value if optional [ print length? opt-value ] ] my-func 33 my-func/optional 22 "tadam" my-func/optional 22 44 |
alemar 18-Jan-2011 [4190x3] | the name did seem a bit slav... :D |
tnks pasin to my little vault.. | |
pastin | |
jack-ort 8-Apr-2011 [4193] | thinking of using objects for the first time, using them to capture clinical data for patients. Need to capture data by time; still just a fuzzy idea. I have read how you can extend an object by simply redefining it with new values, but I wonder if there is a way to REMOVE elements from an object? TIA! |
Henrik 8-Apr-2011 [4194] | In R2, you can do this: 1. get the body of the object as a block 2. find the word you want to remove 3. remove the word and its value coming right after 4. make a new object from the block |
jack-ort 8-Apr-2011 [4195] | ah! That makes sense! Thank you Henrik! It is good to be working (learning) REBOL again, knowing that help is so fast to find on AltMe. I notice you specified R2 - without asking for details, will this be different in R3? |
Henrik 8-Apr-2011 [4196] | In R3 you have more options for manipulating objects a little bit like series, without having to re-make the object, although I'm uncertain that you can remove elements from objects. But then you also have the map! datatype, which is more suitable for very quick adding and removing of key/value pairs. |
jack-ort 8-Apr-2011 [4197] | map! ?? so much to learn. Again, thank you! |
Henrik 8-Apr-2011 [4198] | http://www.rebol.com/r3/docs/datatypes/map.html I see it has not yet been documented. I seem to remember that it was, but I might be wrong. |
BrianH 8-Apr-2011 [4199x2] | You won't be able to remove elements from an object even in R3, because it would break binding. But you can create a new object without the field, or use a map!, just as Henrik says. Note that you can also TRIM objects in R3, which will make a new object based on the old one with unset fields and fields set to none not included in the new object. |
>> trim context [a: 1 b: none] == make object! [ a: 1 ] >> trim context [a: 1 b: 2 unset 'b] == make object! [ a: 1 ] | |
Henrik 8-Apr-2011 [4201] | interesting |
jack-ort 11-Apr-2011 [4202] | BrianH said: "But you can create a new object without the field,...." Sorry to be especially dense, but do you mean create the new object from scratch, or based on the old object? I've seen the examples to create new from old and also adding fields, or resetting the value of an existing field, but never excluding old fields. I look forward to more documentation on "map!"; maybe I should move to R3. Last I checked, there was no GUI in R3, even the Windows version, despite what the download page says? One last newbie question for the day - will there be a 64-bit REBOL? I'm thinking my data could get rather large before too long. Thanks to all of you! |
Ladislav 11-Apr-2011 [4203x2] | Sorry to be especially dense, but do you mean create the new object from scratch, or based on the old object? - specially in this case he means the above example |
Last I checked, there was no GUI in R3, even the Windows version, despite what the download page says? there is R3-GUI, which can be downloaded. check the announcements, etc. A new version will be published this week | |
jack-ort 11-Apr-2011 [4205] | Hello Ladislav! That is great news regarding R3-GUI! Re. BrianH's examples, I read those as specific to the R3 TRIM function, so I assumed his other comment referred to some alternative approach. Obviously I have much to learn. Thank you! |
Ladislav 11-Apr-2011 [4206] | Alternative approach is certainly possible, but the usage of the TRIM function looks quite comfortable, I guess. |
jack-ort 11-Apr-2011 [4207] | But only in R3, correct? |
Ladislav 11-Apr-2011 [4208x3] | Certainly not, this approach (not using the Trim function, though, can be emulated in R2 |
It is possible to define a REBOL function doing that | |
For example, using the approach Henrik outlined above. | |
BrianH 11-Apr-2011 [4211x2] | I meant creating a new object from scratch, not based on a direct prototype. For example: >> x: make object! [a: 1 b: 2 c: 3] == make object! [ a: 1 b: 2 c: 3 ] >> y: make x [d: 4] ; creating based on a direct prototype: == make object! [ a: 1 b: 2 c: 3 d: 4 ] >> z: make object! head remove/part find body-of x 'b 2 ; making based on the body of x, but not directly on x == make object! [ a: 1 c: 3 ] |
Those will work in R2 as well, and the latter (z) is how you can make new objects based on old objects, but with removed fields. You can't make an object with fewer fields by direct prototyping, and you can't remove fields from existing objects. | |
jack-ort 11-Apr-2011 [4213] | Thanks to both Ladislav and Brian for taking the time to make that clear! |
jack-ort 12-Apr-2011 [4214] | Hello again! Cannot see how to make BrianH's example work in REBOL/View 2.7.8; hungup on how to FIND a set-word: >> x >> probe x make object! [ a: 1 b: 2 c: 3 ] >> z: make object! head remove/part find body-of x 'b 2 ** Script Error: head expected series argument of type: series port ** Where: halt-view ** Near: z: make object! head remove/part >> find body-of x 'b == none >> body-of x == [a: 1 b: 2 c: 3] >> find body-of x 'b: == none |
Sunanda 12-Apr-2011 [4215] | Brian's code uses an R3-ism: 'body-of. Equivalent R2 code looks like this: z: make object! head remove/part find third x to-set-word 'b 2 |
jack-ort 12-Apr-2011 [4216] | Thanks Sunanda! 2.7.8 has "body-of"; now I know about using third of an object too! What I was missing was the "to-set-word" - now I am off and running again. |
BrianH 12-Apr-2011 [4217] | Sunanda, BODY-OF was backported to R2 in 2.7.7 :) |
GrahamC 12-Apr-2011 [4218] | Brian .. what was ported is unclear to most people |
BrianH 12-Apr-2011 [4219x5] | The real R3ism was the FIND call, unfortunately. >> body-of context [a: 1 b: 2 c: 3] == [a: 1 b: 2 c: 3] >> find body-of context [a: 1 b: 2 c: 3] 'b == none >> find body-of context [a: 1 b: 2 c: 3] [b:] == [b: 2 c: 3] |
In R3, the first FIND call would have worked too. | |
I can't backport the FIND changes in R3 without breaking compatibility, so it's going to be a standing difference in the future. | |
Jack, it is not a good idea to use the ordinal reflectors (third object and such) unless you need to run on an old version of R2 (pre-2.7.7 with R2/Forward not loaded). It makes your code harder to read, and less forwards compatible with R3. | |
In R3 the ordinal reflectors were deliberately removed for security purposes (mostly sandboxing). | |
jack-ort 12-Apr-2011 [4224] | Thanks Brian! Duly noted. If R3 was at least beta, I'd make the switch w/o looking back. |
Geomol 17-Apr-2011 [4225] | New people should check group "Private Groups" for groups, they might be interested in to join. And then just ask to be joined, and it will happen! |
JosDuchIt 22-May-2011 [4226] | Hello , I am new, just testing this inteface. |
Henrik 22-May-2011 [4227] | welcome! |
JosDuchIt 22-May-2011 [4228] | How can i write a message larger than one line? |
Henrik 22-May-2011 [4229] | Click the "pencil" in the toolbar above the write line. |
JosDuchIt 22-May-2011 [4230] | Thanks I am an Amiga OS4.1 user, have had some contacts with Rebol when it first started up on this "mother" pmlatform and am very happy Reboll3 is cominbg back to it. Any info on when View will be available ? Or can an older version of View be used with R3? |
Henrik 22-May-2011 [4231] | I don't think it can be used. It will probably be a while before the Amiga version resumes, as Carl, the main developer, is taking a break to work on other projects. We need some more development on the core of R3 before it can continue. |
JosDuchIt 22-May-2011 [4232x2] | Again about this interface then |
Can i use a bigger font? I can't reach the resize button to reduce the window somewhatt. How can this be done? Is it possible to do a search in a group or the whole of ta world? | |
Henrik 22-May-2011 [4234] | There is an "aA" button next to the "pencil" button, but it varies with platform whether it works. |
older newer | first last |