[REBOL] My 2 cent contribution Re:
What are you talking about tim [EMAIL PROTECTED] wrote: Really appreciate all of you guys hard work and i know this is the one that will make this whole internet thing fall into place if you make enough noise. So how do you get it in every computer? Easy. Give away a message app. with friend list auto forwarding and retrieving for files and attachments(the clincher, will not allow unknown attachments to get to the personal computer thats not from friends),with calender. Run it all on the Rebol server.r script from the personal computer. It's still lightweight, personal and can talk to anyone (smaller & less hassel than java) on and off line as a full blown executing app. Remember it's only a rebol view and rebol core script. It would'nt be hard to do. (it has been done allready but its in pieces all over the place) HOW? It MUST operate like a VIRUS. The mail from the friend is prewritten asking if the reciever would like to message with the sender personally on & off line with calender forwarding and retrival of personal info. Tell them that now they can verify if you sent them an attachment. Next, they click (one click for win32's,Linux, & Mac) the yes link and Reb core downloads followed by rebol view. Reb view app. opens and asks to send same Reb welcome letter to their friend email addresses. Make sure you put one of those thingamabobs (Reb link) on it. Who knows they might get Rebolutionized. Rebolists should be encouragd to put this link on their web page as well as a replacement for the guest books. Now What? Just wondering if its possible for those who spread the Rebol app. to a certain number of friends could be given a free email address for messaging. Encourage that through Rebol email we have our first true means for networking in a one to many messaging enviornment. Who can do it? Well, RT should build the initial script, (it has to be a true Rebol.r for publicity reasons) a skeleton if you will. Post the script to the www & mail list as the first Open Source Script. It's open because anyone can add their own gui's and upgrades to it through a script list. Now users can customize with out having to program.(thats want public users like about apps anyway when they are non trivial)
[REBOL] "Self" is mysterious Re:
Howdy, Don: SELF is a word in every object which by default refers to the object itself. By setting, in the process of making an object, the word SELF in the object's context to something other than that object, in effect, whatever you are assigning that object to will instead be assigned to what you set SELF to. The same is not true after you've made the object. -jeff > Perhaps "self" can NOT be used as a regular? Rebol word: > >> x: make object! [a: 1 b: 2 ] >> type? x == object! > >> x: make object! [a: 1 b: 2 sel: 3] >> type? x == object! > >> x: make object! [a: 1 b: 2 self: 3] == 3 >> type? x == integer! > Mystery abounds, > Don > > >
[REBOL] My 2 cent contribution
Really appreciate all of you guys hard work and i know this is the one that will make this whole internet thing fall into place if you make enough noise. So how do you get it in every computer? Easy. Give away a message app. with friend list auto forwarding and retrieving for files and attachments(the clincher, will not allow unknown attachments to get to the personal computer thats not from friends),with calender. Run it all on the Rebol server.r script from the personal computer. It's still lightweight, personal and can talk to anyone (smaller & less hassel than java) on and off line as a full blown executing app. Remember it's only a rebol view and rebol core script. It would'nt be hard to do. (it has been done allready but its in pieces all over the place) HOW? It MUST operate like a VIRUS. The mail from the friend is prewritten asking if the reciever would like to message with the sender personally on & off line with calender forwarding and retrival of personal info. Tell them that now they can verify if you sent them an attachment. Next, they click (one click for win32's,Linux, & Mac) the yes link and Reb core downloads followed by rebol view. Reb view app. opens and asks to send same Reb welcome letter to their friend email addresses. Make sure you put one of those thingamabobs (Reb link) on it. Who knows they might get Rebolutionized. Rebolists should be encouragd to put this link on their web page as well as a replacement for the guest books. Now What? Just wondering if its possible for those who spread the Rebol app. to a certain number of friends could be given a free email address for messaging. Encourage that through Rebol email we have our first true means for networking in a one to many messaging enviornment. Who can do it? Well, RT should build the initial script, (it has to be a true Rebol.r for publicity reasons) a skeleton if you will. Post the script to the www & mail list as the first Open Source Script. It's open because anyone can add their own gui's and upgrades to it through a script list. Now users can customize with out having to program.(thats want public users like about apps anyway when they are non trivial)
[REBOL] How to parse REBOL source code.
REBOL [ Title: "Parse REBOL Source" Author: "Carl Sassenrath" File: %parse-source.r Date: 27-May-2000 Purpose: {Example parser for REBOL source code.} Category: [script util text 2] ] parse-source: func [ "Parse REBOL source code." text /local str new ][ parse text blk-rule: [ some [ ; repeat until done str: newline | #";" thru newline new: (probe copy/part str new) | [#"[" | #"("] blk-rule | [#"]" | #")"] | skip (set [value new] load/next str probe :value) :new ] ] ] parse-source read %parse-source.r
[REBOL] "Self" is mysterious
Perhaps "self" can NOT be used as a regular? Rebol word: >> x: make object! [a: 1 b: 2 ] >> type? x == object! >> x: make object! [a: 1 b: 2 sel: 3] >> type? x == object! >> x: make object! [a: 1 b: 2 self: 3] == 3 >> type? x == integer! Mystery abounds, Don
[REBOL] Script Cleaner
Here's a useful little script for those of you who are diligently working on REBOL this Memorial Day weekend. -Carl REBOL [ Title: "REBOL Script Cleaner" Author: "Carl Sassenrath" File: %clean-script.r Date: 27-May-2000 Email: [EMAIL PROTECTED] Purpose: { Cleans REBOL scripts by parsing the REBOL code and supplying standard indentation and spacing. } Note: { This script produces STANDARD script indentation and spacing. No doubt you will want to modify it to use your own rules. Send your enhancements and I will consider adding them to the distribution... but keep this header intact and keep the code clean. No hacks. } Category: [script util text 3] History: [ "Carl Sassenrath" 1.0.0 27-May-2000 "Original program." ] ] script-cleaner: make object! [ out: none ; output text spaced: off ; add extra bracket spacing indent: "" ; holds indentation tabs emit-line: func [] [append out newline] emit-space: func [pos] [ append out either newline = last out [indent][ pick [#" " ""] found? any [ spaced not any [find "[(" last out find ")]" first pos] ] ] ] emit: func [p1 p2] [emit-space p1 append out copy/part p1 p2] set 'clean-script func [ "Returns new script text with standard spacing." script "Original Script text" /spacey "Optional spaces near brackets and parens" /local str new ][ spaced: found? spacey out: append clear copy script newline parse script blk-rule: [ some [ str: newline (emit-line) | #";" thru newline new: (emit str new) | [#"[" | #"("] (emit str 1 append indent tab) blk-rule | [#"]" | #")"] (remove indent emit str 1) | skip (set [value new] load/next str emit str new) :new ] ] remove out ; remove first char ] ] ;Example: print clean-script read %clean-script.r
[REBOL] slogan, anyone? Re:(2)
[EMAIL PROTECTED] wrote: > Ralph, funny you should mention it. That's how I tried to start the > Dobb's article about REBOL to be published next month: > > The American Revolutionary War began with a communications > protocol. Our children enjoy telling the story of the advantage > gained by the 1775 service provider who broadcast an encrypted > message using speed-of-light optical technology: one if by land, > two if by sea. > > Communications is so fundamental and natural to humans that we > don't give it much thought. Message protocols, such as lanterns > in the old Boston church tower, depend on clearly defined > symbols delivered in a particular order. But, a protocol is > defined as much by what it implies as what it states. If no > lanterns appeared we would assume that the invaders had yet to > arrive (or arrived too soon, and we would not be telling this > story). And, what if three lanterns had appeared that fateful > night? An air invasion? No, but perhaps troops coming both by > land and by sea. > > They chopped it and asked me to rewrite it more blandly. Guess they > were worried about exciting the English readers Or maybe Pekr? Hey, what's the point? ;-) I am used to read abstract things, I very often read Tim Rue's posts and try to understand what the VIC in real life would be about :-) Besides that, shouldn't that article be out in a May issue? I visited Prague, checked the magazine and ... nothing. I was so excited, I thought for myself - hmm, they are so busy they should invite old good pekr to Ukiah to do some houseworks, bring them real beer from Czech Republic and let them to concentrate on a real stuff :- but then I would have to let the world know - REBOL is a technology coming from Aliens, it's part of much greater plan :-) ... Rooswelt 1948, Ukiah 1998 ... folks, keep an eye on the night sky ... and be carefull, as REBOL breaks your programming habits :- -pekr-, swallowed by REBOL > -Carl > > At 5/26/00 11:51 PM -0400, you wrote: > >Maybe it's late on a Friday night (well, it is) but the following REBOLian > >slogan occurs to me: > > > >The REBOLution grows. One if by LAN, two if by C; dont start coding until > >you see the whites of their eyes! > > > >okay, okay... I'll go to bed now. > > > >Best to all, > > > >--Ralph Roberts > >
[REBOL] hidden variables in objects? Re:(9)
Not a follow up, but for those that are interested in little REBOL "hacks", hidden object variables, etc, try playing around with this: x: make object! [a: 1 b: 2] x/self: make object! [a: 11 b: 22] And now there's some hidden vars in X. x/a x/self/a Nothing truly mysterious here. Self is a word, that by default refers to the self same object. The word can be used to point to another object as well. If self instead points somewhere else, that's okay, but self won't be copied if you clone that object. Now for some mysterious stuff: x: make object! [self: make self [a: 1 b: 2] c: 3 d: 4] What do you suppose is happening here? :-) It's a little mystery. (-: -jeff
[REBOL] multithreaded cmd, ports Re:
Howdy, Pawel: > Dear list, > I'm new to Rebol, and I'm sorry if I'm asking about anything that has been > already discussed. > Here are two scripts (attached) which allow me to run a Rebol script via > cgi. Neat stuff. > 1. I need to check if there is any data to read from non-listen port without > waiting for it (functions: 'check-cgi? and 'read-cgi). I wonder if there is > any simplier, WORKING method, than changing the default timeout. By not waiting for it you mean not using something like the following?: if port? wait reduce [cmd-port .5] [fetch-stuff from port] The wait will return after half a second with either NONE or your port if there's data in it. Also, once you have a talk port connected (not a listen port), you should also be able to use query to determine when there's data within the port. > 2. If the scripts are worth uploading them to rebol.org, what should be > their category? Probably: [advanced web] -jeff
[REBOL] Re: Objects (and|or) context problem Re:
Hello [EMAIL PROTECTED]! On 27-Mag-00, you wrote: l> you should have written: l> main: copy [] l> foreach [n v] second block [ l> insert tail main compose [(to-set-word rejoin [first ^^^ This is a problem, too. Better: insert tail main reduce [make set-path! reduce [first block :n] v] l> insert tail main head insert tail to path! first block 'f Or: insert tail main make path! reduce [first block 'f] Regards, Gabriele. -- Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] Re: hidden variables in objects? Re:(7)
Hello [EMAIL PROTECTED]! On 26-Mag-00, you wrote: c> True, REBOL is not OO, it is OB (object-based). However, I c> think View proves that the object inheritance provided in c> REBOL is quite powerful. VID (Visual Interface Dialect) kernel c> is a good example. Yes, and I fully agree with you. :-) c> As you know, I've been into every aspect of OOL since 1980. c> I've found that most OOLs do NOT make me more productive... in c> fact, quite often the opposite. Ideed, I found REBOL much more appealing than all the other (OO) languages I've used before. OOP leads inevitably to complexity, and current software is a clear proof of that. REBOL, instead, leads you to use simpler concepts and simpler designs. c> WRT hidden vars: REBOL modules will give you two flavors of c> that. That's good news. BTW, will the GC bug eventually be fixed? ;-) c> BTW, I'm curious as to your definition of "real inheritance"? c> I missed that thread. Shared instance state? I think one would need a class hierarchy, and surely dynamic binding (instead of the static binding of REBOL). Anyway, I prefer choosing non-OO designs for my scripts, so I don't need "real inheritance". This usually requires more design effort for me, because my past experience with other languages (mostly AmigaE and C++) makes me often think the OO way, but usually I get a much better solution with the REBOL way. Regards, Gabriele. -- Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] slogan, anyone? Re:
Ralph, funny you should mention it. That's how I tried to start the Dobb's article about REBOL to be published next month: The American Revolutionary War began with a communications protocol. Our children enjoy telling the story of the advantage gained by the 1775 service provider who broadcast an encrypted message using speed-of-light optical technology: one if by land, two if by sea. Communications is so fundamental and natural to humans that we don't give it much thought. Message protocols, such as lanterns in the old Boston church tower, depend on clearly defined symbols delivered in a particular order. But, a protocol is defined as much by what it implies as what it states. If no lanterns appeared we would assume that the invaders had yet to arrive (or arrived too soon, and we would not be telling this story). And, what if three lanterns had appeared that fateful night? An air invasion? No, but perhaps troops coming both by land and by sea. They chopped it and asked me to rewrite it more blandly. Guess they were worried about exciting the English readers Or maybe Pekr? -Carl At 5/26/00 11:51 PM -0400, you wrote: >Maybe it's late on a Friday night (well, it is) but the following REBOLian >slogan occurs to me: > >The REBOLution grows. One if by LAN, two if by C; dont start coding until >you see the whites of their eyes! > >okay, okay... I'll go to bed now. > >Best to all, > >--Ralph Roberts >
[REBOL] refinements Re:(9)
Oops, cut/pasted the not-working version (see the difference between the line: append getargs compose [get/any (arg)] append getargs compose [get/any (to lit-word! arg)] ). My apologies to all. Regards Ladislav refined: func [ {Create a function doing the same thing as a function with given refinements does} [catch] f [any-function!] refinements [block!] /local spec body f-spec mode append-mode item holder getargs simple-spec ] [ append-mode: [ if not refinement? :item [ either block? :item [ append/only spec load mold :item ] [ append/only spec :item ] ] ] spec: copy [] f-spec: third :f mode: append-mode while [not tail? f-spec] [ item: first f-spec f-spec: next f-spec do mode if refinement? :item [ if :item = /local [break] item: to word! :item either find refinements :item [ mode: append-mode ] [ mode: [] ] ] ] simple-spec: first func spec [] holder: make object! compose/deep [f: first [(:f)]] body: bind compose [ (:holder) (to path! append copy [f] refinements) ( getargs: copy [] foreach arg simple-spec [ append getargs compose [get/any (to lit-word! arg)] ] getargs ) ] in holder 'f func spec body ] { Example: insert-only: refined :insert [only] }
[REBOL] Objects (and|or) context problem Re:
Ahoj, Your problem lies here: >> type? last main == word! instead of: main: copy [] foreach [n v] second block [ insert tail main compose [(to-set-word rejoin [first block "/" :n]) (v)] ] insert tail main to-word join first block "/f" you should have written: main: copy [] foreach [n v] second block [ insert tail main compose [(to-set-word rejoin [first block "/" :n]) (v)] ] insert tail main head insert tail to path! first block 'f Regards Ladislav - Původní zpráva - Od: <[EMAIL PROTECTED]> Komu: <[EMAIL PROTECTED]> Odesláno: 27. května 2000 14:17 Předmět: [REBOL] Objects (and|or) context problem > Zdravim, > > please, look at my problem: > > I need two functions - first makes derivation of some object and the second > makes block that sets values in the new object and than makes a function found > in the same object. From the command line the function works but when called > in the block, REBO says it does not exists. > > Can anybody help me please? > > >> parent-object: make object! [ a: 1 b: 2 f: func[][print [a b]]] > ;; this is the 'base' object > >> block: [hu [a: 3 b: 4]] > == [hu [a: 3 b: 4]] > ;; block with settings (function 'f' is same for all derivations) > ;; in format [name [values] another-name [another-values] ...] > >> set first block do [make parent-object second block] > ;; this selects needed values and makes object out of them > >> probe hu > > make object! [ > a: 3 > b: 4 > f: func [][print "sucsess"] > ]* > * > ;; still seems OK > >> main: copy [] > >> foreach [n v] second block [ >insert tail main compose [(to-set-word rejoin [first block "/" :n]) (v)] >] >insert tail main to-word join first block "/f" > >> head main > == [hu/a: 3 hu/b: 4 hu/f] > ;; this makes block that changes values in the existing object > ;; and than evaluates 'f function > >> hu/f > 3 4 > ;; BUT, NOW LOOK AT THE PROBLEM > >> do main > ** Script Error: hu/f has no value. > ** Where: hu/f > > If I insert probe hu into the block there IS 'f function in 'hu object. > > Do I have to make new object with the same name everytime I want just to > change some values in the object? > > Louci se > -- > --you've been/byl jsi contacted/kontaktovan > --- > [EMAIL PROTECTED] > -www.volny.cz/weirddream > > > >
[REBOL] Objects (and|or) context problem
Zdravim, please, look at my problem: I need two functions - first makes derivation of some object and the second makes block that sets values in the new object and than makes a function found in the same object. From the command line the function works but when called in the block, REBO says it does not exists. Can anybody help me please? >> parent-object: make object! [ a: 1 b: 2 f: func[][print [a b]]] ;; this is the 'base' object >> block: [hu [a: 3 b: 4]] == [hu [a: 3 b: 4]] ;; block with settings (function 'f' is same for all derivations) ;; in format [name [values] another-name [another-values] ...] >> set first block do [make parent-object second block] ;; this selects needed values and makes object out of them >> probe hu make object! [ a: 3 b: 4 f: func [][print "sucsess"] ]* * ;; still seems OK >> main: copy [] >> foreach [n v] second block [ insert tail main compose [(to-set-word rejoin [first block "/" :n]) (v)] ] insert tail main to-word join first block "/f" >> head main == [hu/a: 3 hu/b: 4 hu/f] ;; this makes block that changes values in the existing object ;; and than evaluates 'f function >> hu/f 3 4 ;; BUT, NOW LOOK AT THE PROBLEM >> do main ** Script Error: hu/f has no value. ** Where: hu/f If I insert probe hu into the block there IS 'f function in 'hu object. Do I have to make new object with the same name everytime I want just to change some values in the object? Louci se -- --you've been/byl jsi contacted/kontaktovan --- [EMAIL PROTECTED] -www.volny.cz/weirddream
[REBOL] refinements Re:(8)
Hi, this thread inspired me to write: to-func: func [ {Create a function doing the same thing as a function with given refinements does} [catch] f [any-function!] refinements [block!] /local spec body f-spec mode append-mode item n holder getargs simple-spec ] [ append-mode: [ if not refinement? :item [ either block? :item [ append/only spec load mold :item ] [ append/only spec :item ] ] ] spec: copy [] f-spec: third :f mode: append-mode while [not tail? f-spec] [ item: first f-spec f-spec: next f-spec do mode if refinement? :item [ if :item = /local [break] item: to word! :item either find refinements :item [ mode: append-mode ] [ mode: [] ] ] ] simple-spec: first func spec [] holder: make object! compose/deep [f: first [(:f)]] body: bind compose [ (:holder) (to path! append copy [f] refinements) ( getargs: copy [] foreach arg simple-spec [ append getargs compose [get/any (arg)] ] getargs ) ] in holder 'f func spec body ] { Example: insert-only: to-func :insert [only] } Regards Ladislav
[REBOL] slogan, anyone? Re:
The piercing warning cry of the Paul Revere and the Rebols: "The Redmonds are coming, The Redmonds are coming,..." We must protect the freedom and liberty for future computing from the tyranny of complexity. Rebol, the new platform for democratization of the Internet... (I did swipe a Rebol flag in St. Louis A2k...I have it in my van) Steve Shireman [EMAIL PROTECTED] wrote: > > Maybe it's late on a Friday night (well, it is) but the following REBOLian > slogan occurs to me: > > The REBOLution grows. One if by LAN, two if by C; dont start coding until > you see the whites of their eyes! > > okay, okay... I'll go to bed now. > > Best to all, > > --Ralph Roberts
[REBOL] refinements Re:(7)
Hi, is this close to what you wanted to have? f1: function [/va /vb /vc][path-list r-word][ path-list: to path! 'f2 foreach r first :f1 [ if all [ refinement? r r <> /local get r-word: bind to word! r 'r-word ] [ insert tail :path-list r-word ] ] print ["Calling path:" mold :path-list] ] Regards Ladislav > f1: function [/va /vb /vc][param-list param-values r path-list][ > param-list: make block! [] > param-values: make block! [] > foreach r first :f1 [ > if (refinement? r) and (r <> /local) [ > append param-list r > append param-values get bind to-word r 'param-list > ]] > path-list: join [f2] param-list > print ["Calling path:" mold to-path path-list] > do to-path path-list > ] > > f2: function [param-list][va vb vc][ > foreach r param-list [ > print r > ] > ] > > >> f1/vb > Calling path: f2//va//vb//vc > > Doesn't work (yet). > > - Michael Jelinek > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 26, 2000 10:10 AM > To: [EMAIL PROTECTED] > Subject: [REBOL] refinements Re:(5) > > > Funny that you mention it. It slipped from our lists, but we do need to > evaluate dynamically built refinement blocks. E.g: > > do to-path [insert part] a b > > Should be the same as: > > insert/part a b > > Comments? > > -Carl > > > At 5/26/00 08:55 AM -0700, you wrote: > >Oh yes, I've considered restructuring things, but the current arcitecture > is > >the one that best suits all of my needs (the best one that I have been able > >to think of, anyway). Specifically, when I define a function element in an > >object, that function does nothing more than to call another function (not > >defined as part of the object) to do the work. For example: > > > >door-man: make object! [ > > vocab1: "hello" > > vocab2: "world" > > speak: func [][say-greeting self] > >] > > > >say-greeting: func [idiot][ > > print [idiot/vocab1 idiot/vocab2] > >] > > > >door-man/speak > > > >This simple example is neat and clean. The messy part is when I also have > to > >pass-through refinements. Then I not only have to keep both functions in > >sync with the refinement list, but I also have to keep the 'if statements > in > >sync. I've been doing that with the assumption that I only specify a single > >refinement at a time. To save me just that much more work, it'd be nice to > >have some automatic way of passing the refinements. > > > >I have considered passing the refinements as a block, and even the idea of > >defining them as an object (within the pass-through function) is appealing. > >This involves looping to get the refinement! values from the first block of > >the function. But the only way I know how to get the value of a refinement! > >type is to cast it as a word!, then use 'get, then bind it to the current > >context (ick). It seems like there should be a way to evaluate a > refinement! > >type directly. That would make me happy. > > > >- Michael Jelinek > > > >-Original Message- > >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > >Sent: Friday, May 26, 2000 2:30 AM > >To: [EMAIL PROTECTED] > >Subject: [REBOL] refinements Re:(3) > > > > > >[EMAIL PROTECTED] wrote: > >> But (unless I don't get it, here) this uses exactly what I am trying to > >avoid using: an 'if statement for each possible refinement. I agree it's > >easier and more straight forward, but it also creates more work to maintain > >(such as when refinements are added to a function). Since I use this > >"pass-through of refinements" idea as a common practice in my program, the > >added maintenance adds up. > > > >It's only one 'if per refinement that's to be passed through. It avoids > >multiple combinations of 'ifs. For each refinement added, it's only one > >extra 'if to write. I believe that this approach is only a small price to > >pay. > >If you're commonly passing refinements through to subfunctions, > consider > >restructuring your software. It may be better to use a different approach, > >perhaps using objects? > > > >YMMV. :-) > > > >Andrew Martin > >ICQ: 26227169 > >http://members.xoom.com/AndrewMartin/ > >-><- > > > >