[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(4)
[EMAIL PROTECTED] wrote: I've got back to Aug 1999 in Outlook Express if that helps. IMHO If you go back much further than that, there isn't much of relevance to v2.x of REBOL I think I have all rebol ml messages. The problem is - it's here and there, as I have changed computers and accessing net from home and from work too ... :-) -pekr- Cheers, Allen K - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 12:13 PM Subject: [REBOL] Re: eScribe Rebol Archive vs rebol.org Archive Re: Hello [EMAIL PROTECTED] On 07-Sep-00, [EMAIL PROTECTED] wrote: However, Ryan, I noticed that the eScribe FAQ says you can import older messages into the system. Have you looked at doing this? This would be awesome if someone could make this happen. Good idea. I will look into this, but someone at RT would have to help me out (unless there is some way to retrieve all old messages automatically?) I have all the mail form 1-10-2000 to the present and can send as html if that is what is needed-let me know Regards -- The only thing that stops God from sending another flood is that the first one was useless. -- Chamfort JMS Trustee http://www.jms.org HP=http://www.sonic.net/~alanwall/ First computer solar powered vic-20 AmigaQNX-notAmigaNG=no good computers for people not suits sent via Yam ver2 on AmigaForever ver3 Be a Rebel get [EMAIL PROTECTED] UIN#=9391028
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(4)
would you be able to export just the rebol messages from Outlook? I've got back to Aug 1999 in Outlook Express if that helps. IMHO If you go back much further than that, there isn't much of relevance to v2.x of REBOL Cheers, Allen K - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 12:13 PM Subject: [REBOL] Re: eScribe Rebol Archive vs rebol.org Archive Re: Hello [EMAIL PROTECTED] On 07-Sep-00, [EMAIL PROTECTED] wrote: However, Ryan, I noticed that the eScribe FAQ says you can import older messages into the system. Have you looked at doing this? This would be awesome if someone could make this happen. Good idea. I will look into this, but someone at RT would have to help me out (unless there is some way to retrieve all old messages automatically?) I have all the mail form 1-10-2000 to the present and can send as html if that is what is needed-let me know Regards -- The only thing that stops God from sending another flood is that the first one was useless. -- Chamfort JMS Trustee http://www.jms.org HP=http://www.sonic.net/~alanwall/ First computer solar powered vic-20 AmigaQNX-notAmigaNG=no good computers for people not suits sent via Yam ver2 on AmigaForever ver3 Be a Rebel get [EMAIL PROTECTED] UIN#=9391028
[REBOL] Trying to compose a block out of global and local bindings Re:
Hi princepawn, pretty much everything has already been said. (1) I just happened to notice that you redefine form (was pointed out) AND use reform: source reform reform: func [ "Forms a reduced block and returns a string." value "Value to reduce and form" ][ form reduce value ] You see that reform uses form. So at the time you evaluate reform, if we explicitly replace form by the value you assigned to it, then we get: reform: func [ "Forms a reduced block and returns a string." value "Value to reduce and form" ][ ["hi" name "welcome back"] reduce value ] reform no long performs a FORM on its argument! Since the result of a function is the value its body evaluates to (unless you use return at some point) in this case reform will simply return its reduced argument. Which leads me to ... ... (2) you use [ name: n print reform reduce b] ... reform reduce ... Recall the implementation of reform. The reform function performs a reduce on its argument, and therefore your explicit use of reduce is redundant. The whole difference between reform and form is that reform first REDUCEs its argument before it FORMs it. But you are using print ... ... and (3) print reduces its argument quite on its own anyway. The print function accepts a block as its argument and is not limited to an argument of type string!. Therefore you do not need to reduce or reform b. Passing b to print alone will work just fine, provided the name in the b block is bound to the context of foreach. Which leads me to ... ... A final word. What name evaluates to depends on the context in which it is defined. There are two instances of name involved in your function. One instance of name is bound to the global context: ["hi" name "welcome back"] where name is associated with the string "Bob". The other name is local to the function. When you set name to the value of n, then you are setting the instance of name that is bound to the local function to that value (obviously). The argument you pass to reduce, however, is the block that was constructed in the global context, and therefore the name instance it contains is the name bound to the global context. Actually you do not want the second name instance to be local to the letter2 function. You want the second name instance to be bound to the foreach (native!) function. So, you could say letter2: func [b] [ foreach name ["Sue" "Sally"] [ print bind b 'name ] ] Here BIND directs REBOL to associate all words contained in 'b with the "closest" context that contains the symbol name. Because 1. the context in which the BIND expression is being used is the block passed to foreach, and 2. a) because the first argument passed to foreach (foreach name ...) is an instance of the word name b) there therefore now exists an instance of the word name that is bound to foreach's context, 3. == therefore a) REBOL will identify foreach's context as the "closest" context in which 'name occurs. This is the context to which all words in the block b are now being bound, provided they are defined in foreach's context. b) Because of 3.a) the symbol name in the block b will be bound to the foreach context. (If the block b contained other words and some or all of these other words were also defined in the foreach context, then all these words would be bound to the foreach context as well. Words that are not defined in the foreach context remain bound to whichever context they originated in, when the block b was formed, or they remain unset!, if they were never set to a value to begin with). RESULT: name: "Bob" == "Bob" message: ["hi" name "welcome back"] == ["hi" name "welcome back"] letter2: func [b] [ [ foreach name ["Sue" "Sally"] [ [ print bind b 'name [ ] [] letter2 message hi Sue welcome back hi Sally welcome back Note that as a side-effect the symbol name in the message block remains bound to the value it was last associated with in the letter2 function: reduce message == ["hi" "Sally" "welcome back"] If that should be relevant, i.e. you want to prevent the modification of the binding of the word name in the original message block, you can use bind/copy, which generates a duplicate of the block, before it binds it: letter2: func [b] [ foreach name ["Sue" "Sally"] [ print bind/copy b 'name ] ] letter2 message hi Sue welcome back hi Sally welcome back reduce message == ["hi" "Bob" "welcome back"] Note that the word used as foreach's first argument (foreach name ...) is not bound in the context of your letter2 function in which foreach is evaluated. It is bound in the context of foreach. Let us demonstrate that by collecting different instances of name into a block. We being with the global instance: names: [] == [] name: "This is the global instance of name." == "This is the global instance of name." insert tail names 'name == [] names == [name] reduce names == ["This is the global instance of name."]
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(5)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 4:02 PM Subject: [REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(4) would you be able to export just the rebol messages from Outlook? According to the e-scribe faq they accept Outlook Express .dbx files. This zip file contains the .dbx for messages from mid July-99 thru to end Dec 99 http://www.rebolforces.com/archive/list/List%20Jul-Dec%201999.zip I can upload other months if required, just let me know, I'll upload to the same directory Cheers, Allen K
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(6)
there is a "gimme message" - command somewhere @ selma? and in the X-SELMA: [REBOL] 341927 in the mail-header is a number.. look your missing numbers and write a script.. and tell me this selma - command , somewhere in deep space HD here .. Volker [EMAIL PROTECTED] wrote on 8-Sep-2000/17:13:05+10:00 - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 4:02 PM Subject: [REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(4) would you be able to export just the rebol messages from Outlook? According to the e-scribe faq they accept Outlook Express .dbx files. This zip file contains the .dbx for messages from mid July-99 thru to end Dec 99 http://www.rebolforces.com/archive/list/List%20Jul-Dec%201999.zip I can upload other months if required, just let me know, I'll upload to the same directory Cheers, Allen K
[REBOL] Copyrights Re:
Since it is very important, you should consult a lawyer and explain to him/her your requirements. Different countries have different copyright laws. Some countries have agreements between them so that if your work is protected in one country it may also be protected in another. The site http://www.copyright.org.au is meant to be used by Australians (in Australia copyright protection is automatic). It has a number of useful articles about copyright including an information sheet called "Copyright Protection in Other Countries". This may give you a clue to what you need to consider. That said, it is likely that you will need to understand your home countries copyright law before looking into other countries. Maybe others on this list will add some other links. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 2:52 PM Subject: [REBOL] Copyrights Hello, I live in Peru and I need register my products, copyrigths, etc. Basicly in USA, I think. Please, can somebody tell me what I must do or who contact ? It is very important. Thank you very much. Cristian G. Amayo
[REBOL] Strange chars in password Re:(2)
Very enlightening, but why the local word 'url-value since I can't see it used except for the assignment: url-value: url Can you explain? (Allen?) So that you don't have to construct that all the time, you could do use the following code.. ;--- config: make object! [pass: "password" user: "username"] authenticate: func [ {Returns a filled scheme block complete with password} url [url!] {The url to parse} /local url-value url-obj ][ url-obj: make net-utils/url-parser [] set url-obj/vars none url-value: url parse/all url url-obj/url-rules ;---Return Url data set compose [ scheme: (to-lit-word url-obj/scheme) user: (config/user) pass: (config/pass) host: (url-obj/host) path: (url-obj/path) target: (url-obj/target) ] ] ;e.g usage ; read authenticate ftp://ftp.securesite.com/private/file.dat ; read authenticate http://www.securesite.com/private/file.dat ;-- Cheers, Allen K -- Fantam
[REBOL] Re: x-www-form-urlencoded (bug in bitset! or find ?)
- Open Your Mind - Quoting from my message (03-Sep-00 18:09:43). a First, I'm not sure if I'm doing the right thing by changing the a special characters in the charset: some of my browsers agree with the a previous version, so maybe there's a de-facto standard *I* am not a respecting ... and, as a matter of fact, learning more and more about cookies, I've found one problem. :-) The comma (as well as the semicolon) can be used as a cookie separator. Here's my newest version of url-encode, complete with comments. url-encode: func [ "URL-encodes a string." value [string!] "The string to encode" /local url-encoded-string normal-char char ] compose [ url-encoded-string: make string! "" normal-char: (charset [ #"A" - #"Z" #"a" - #"z" #"0" - #"9" "$-_.!*'()" ]) ; normal chars are defined as per HTML 4.01 specs, section 17.13.4.1, referring to RFC 1738, section 2.2 ; "+" is not a normal char here because it encodes " " ; "," is not a normal char here because it is a special char as per RFC 2109, section 4.3.4 parse/all value [ any [ copy char normal-char (append url-encoded-string char) | copy char " " (append url-encoded-string "+") | copy char newline (append url-encoded-string "%0D%0A") | copy char skip(append url-encoded-string reduce ["%" skip tail (to-hex 0 + first char) -2]) ] ] url-encoded-string ] Alessandro Pini ([EMAIL PROTECTED]) "Hy. Im HAL 9000, your nu ortoghrapphic corecktor."
[REBOL] I give up
I cant figure it out - doc after doc port after port - its killin me. How do you join an irc channel? I did the open port stuff I can do it with telnet but not with REBOL. Look at my script below and tell me whats wrong. I understand I havent accounted for everything that IRC RFC states but should I think have enough to contact the server and join the channel but doesnt work. Any ideas? Paul Tretter -- REBOL[] irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] while [data: copy irc-port] [prin data] insert irc-port "NICK tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port reform "JOIN #REBOLGODS^/" close irc-port
[REBOL] Strange chars in password Re:(3)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 07, 2000 12:55 PM Subject: [REBOL] Strange chars in password Re:(2) Very enlightening, but why the local word 'url-value since I can't see it used except for the assignment: url-value: url Can you explain? (Allen?) Well spotted! I think it is safe to remove. It is part of some job specific code that I removed from the function before posting, looks like I missed that bit. Cheers, Allen K
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(7)
...but then, your message, arriving at my mailbox 12 seconds after the one you copied the X-SELMA number from has the field X-SELMA: [REBOL] 342011 in the header.. I did not get those 84 messages in between.. /PeO there is a "gimme message" - command somewhere @ selma? and in the X-SELMA: [REBOL] 341927 in the mail-header is a number.. look your missing numbers and write a script.. and tell me this selma - command , somewhere in deep space HD here .. Volker
[REBOL] I give up Re:
Perhaps the following (keeping as close to your code as possible) will help... it's very basic but at least you see responses from the IRC server, on the basis of which you'll be able to add more to do what you desire. REBOL[] size: 1 b: make string! size irc-port: [ scheme: 'tcp host: "us.dal.net" port-id: 7000 ] port: open irc-port insert port "NICK tret^/" insert port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" insert port "JOIN #REBOLGODS^/" insert port "WHOIS tret^/" forever [ if 0 length? b [print b clear b]; display replies and clear buffer read-io port b size ; get next replies from server ] ; use ESC to stop program and then manually enter "close port" ; or just wait for port to time out and close itself on error Russ At 09:46 AM 9/8/2000 -0500, you wrote: I cant figure it out - doc after doc port after port - its killin me. How do you join an irc channel? I did the open port stuff I can do it with telnet but not with REBOL. Look at my script below and tell me whats wrong. I understand I havent accounted for everything that IRC RFC states but should I think have enough to contact the server and join the channel but doesnt work. Any ideas? Paul Tretter -- REBOL[] irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] while [data: copy irc-port] [prin data] insert irc-port "NICK tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port reform "JOIN #REBOLGODS^/" close irc-port
[REBOL] I give up Re:(2)
This helps greatly. Now i need to master pong response to server pings. Im curious why you didnt have to close the port every time you made a send. Paul Tretter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, September 08, 2000 12:02 PM To: [EMAIL PROTECTED] Subject: [REBOL] I give up Re: Perhaps the following (keeping as close to your code as possible) will help... it's very basic but at least you see responses from the IRC server, on the basis of which you'll be able to add more to do what you desire. REBOL[] size: 1 b: make string! size irc-port: [ scheme: 'tcp host: "us.dal.net" port-id: 7000 ] port: open irc-port insert port "NICK tret^/" insert port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" insert port "JOIN #REBOLGODS^/" insert port "WHOIS tret^/" forever [ if 0 length? b [print b clear b]; display replies and clear buffer read-io port b size ; get next replies from server ] ; use ESC to stop program and then manually enter "close port" ; or just wait for port to time out and close itself on error Russ At 09:46 AM 9/8/2000 -0500, you wrote: I cant figure it out - doc after doc port after port - its killin me. How do you join an irc channel? I did the open port stuff I can do it with telnet but not with REBOL. Look at my script below and tell me whats wrong. I understand I havent accounted for everything that IRC RFC states but should I think have enough to contact the server and join the channel but doesnt work. Any ideas? Paul Tretter -- REBOL[] irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] while [data: copy irc-port] [prin data] insert irc-port "NICK tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port reform "JOIN #REBOLGODS^/" close irc-port
[REBOL] I give up Re:(3)
Cuz once the port is open, you can keep sending as long as you like... and close it only when done. That's the way ports work. Of course, the way this now stands there's no really safe closing taking place... but you can put that in later when you /QUIT IRC or whatever. Re ping/pong... you'll see them coming at you with this program.. if it stays alive long enough... and you can figure how to parse them and respond. I've done a whole IRC client in REBOL, but not in position to release it in total. It was quite a while ago, so I need lots of head scratching to go back and figure things out... but will help if you're REALLY stuck. Russ PS: Here's the section of my code that does the PONG... but you'll have to infer what 'p is.. and how I parsed it from the PING message received from server (you can ignore my debug and logging mode lines): if (find/case first p "PING") [ ; system PING (reply with PONG) if debug [ foreach item p [prin item] prin newline ] insert irc rejoin["PONG " second p newline] if debug [ print rejoin["PONG " second p newline] ] if logging [ append log rejoin["PONG " second p newline] ] - At 12:26 PM 9/8/2000 -0500, you wrote: This helps greatly. Now i need to master pong response to server pings. Im curious why you didnt have to close the port every time you made a send. Paul Tretter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, September 08, 2000 12:02 PM To: [EMAIL PROTECTED] Subject: [REBOL] I give up Re: Perhaps the following (keeping as close to your code as possible) will help... it's very basic but at least you see responses from the IRC server, on the basis of which you'll be able to add more to do what you desire. REBOL[] size: 1 b: make string! size irc-port: [ scheme: 'tcp host: "us.dal.net" port-id: 7000 ] port: open irc-port insert port "NICK tret^/" insert port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" insert port "JOIN #REBOLGODS^/" insert port "WHOIS tret^/" forever [ if 0 length? b [print b clear b] ; display replies and clear buffer read-io port b size ; get next replies from server ] ; use ESC to stop program and then manually enter "close port" ; or just wait for port to time out and close itself on error Russ At 09:46 AM 9/8/2000 -0500, you wrote: I cant figure it out - doc after doc port after port - its killin me. How do you join an irc channel? I did the open port stuff I can do it with telnet but not with REBOL. Look at my script below and tell me whats wrong. I understand I havent accounted for everything that IRC RFC states but should I think have enough to contact the server and join the channel but doesnt work. Any ideas? Paul Tretter -- REBOL[] irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] while [data: copy irc-port] [prin data] insert irc-port "NICK tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port "USER tret rebol.dyndns.org irc.mindspring.com tret^/" close irc-port irc-port: open/direct/string/no-wait [ scheme: 'tcp host: "irc.mindspring.com" port-id: 6667 ] insert irc-port reform "JOIN #REBOLGODS^/" close irc-port
[REBOL] I give up Re:(4)
I've done a client too, it is available at http://www.algonet.se/~peoyli/RebIRC, but its code needs some more work.. I mostly wrote this to learn Rebol and the IRC protocol, and it was meant to be a bot that jumps into a channel and gets the userlist and leaves again (to make the channel's people's page more interesting).. My solution to the PING/PONG stuff was something like.. handle-irc-cmd: func [] [ switch/default/case irc/command reduce[ "PING" [ insert irc-port rejoin ["PONG " (first irc/params) newline] prin #"^G" ] ... with "irc" being an object which consists of irc-obj: make object! [ prefix: make object! [full: nick: user: host: string!] command: string! params: block! ] (as described in the RFC) /PeO I've done a whole IRC client in REBOL, but not in position to release it in total. It was quite a while ago, so I need lots of head scratching to go back and figure things out... but will help if you're REALLY stuck. Russ
[REBOL] Trying to compose a block out of global and local bindings Re:(2)
Hi Elan, you wrote: letter2: func [b] [ foreach name ["Sue" "Sally"] [ print bind b 'name ] ] Here BIND directs REBOL to associate all words contained in 'b with the "closest" context that contains the symbol name. L: I would recommend to change the wording: {Bind associates all words contained in B (not in 'B, because in 'B is "contained" a block IMHO) with the context previously associated with the word 'Name (again, not Name, as you wrote) which is its second argument.} I am not sure I understand the term "closest" above, I would recommend to not use it here. Elan: Because 1. the context in which the BIND expression is being used is the block passed to foreach, and L: Again, a change suggested. I don't believe, that the block passed to Foreach is a context, sorry. This wording looks better: {The second argument of Bind is the word 'Name previously associated with the context Foreach created.} Elan: 2. a) because the first argument passed to foreach (foreach name ...) is an instance of the word name L: This doesn't make much sense to me too, the sentence: {'Name (the second argument of Bind above) is an instance of the Word! datatype} looks like a correct usage of the word "instance", but it doesn't say what you wanted. I would recommend to look at the previous suggestion. Elan: b) there therefore now exists an instance of the word name that is bound to foreach's context, L: Again a change necessary, IMHO: {There exists a word 'Name that is bound to a context Foreach created.} is the wording I prefer. Elan: 3. == therefore a) REBOL will identify foreach's context as the "closest" context in which 'name occurs. L: I think, that you switched the cause and the consequence here: the truth is, that the word 'Name above (the second argument of Bind) was bound by Foreach to the context it created and that is why "there exists a word 'Name that is bound to a context Foreach created". Elan: This is the context to which all words in the block b are now being bound, provided they are defined in foreach's context. b) Because of 3.a) the symbol name in the block b will be bound to the foreach context. (If the block b contained other words and some or all of these other words were also defined in the foreach context, then all these words would be bound to the foreach context as well. L: I don't like the use of the word "symbol" here. The meaning of it is defined in Rebol. I found the use of this word in Rebol with different meaning, than Rebol assigned to it ambiguous. Elan: Words that are not defined in the foreach context remain bound to whichever context they originated in, when the block b was formed, or they remain unset!, if they were never set to a value to begin with). L: Again a statement I would suggest to change: {Words that are not contained (whether defined or not is irrelevant) in the context Foreach created remain unchanged, while words, that are contained in the context Foreach created are replaced (in B) by their equivalents bound to the above context.} Elan: RESULT: name: "Bob" == "Bob" message: ["hi" name "welcome back"] == ["hi" name "welcome back"] letter2: func [b] [ [ foreach name ["Sue" "Sally"] [ [ print bind b 'name [ ] [] letter2 message hi Sue welcome back hi Sally welcome back Note that as a side-effect the symbol name in the message block remains bound to the value it was last associated with in the letter2 function: reduce message == ["hi" "Sally" "welcome back"] L: Yes, this effect can be considered a self-modification of the code presented, I think. Elan: If that should be relevant, i.e. you want to prevent the modification of the binding of the word name in the original message block, you can use bind/copy, which generates a duplicate of the block, before it binds it: letter2: func [b] [ foreach name ["Sue" "Sally"] [ print bind/copy b 'name ] ] letter2 message hi Sue welcome back hi Sally welcome back reduce message == ["hi" "Bob" "welcome back"] Note that the word used as foreach's first argument (foreach name ...) is not bound in the context of your letter2 function in which foreach is evaluated. It is bound in the context of foreach. L: A different wording: {Note that the word used as Foreach's first argument (foreach name ...) is not bound in the context of your Letter2 function. It is bound in the context Foreach created.} I would prefer not saying, that "...Foreach is evaluated in a context,...", because I don't know, what that should mean. To the contrary, I am pretty sure, that there are examples of Rebol code, for which you cannot find any "context they are evaluated in". Elan: Let us demonstrate that by collecting different instances of name into a block. We being with the global instance: names: [] == [] name: "This is the global instance of name." == "This is the global instance of name." insert tail names 'name
[REBOL] Trying to compose a block out of global and local bindings Re:(2)
Hi, SS wrote: I'll point out quickly that what you're trying to do is generally considered a bad programming practice, i.e. referencing a variable internal to a function from its argument. A caller shouldn't need to know about and shouldn't really have direct access to variables local to a function. I will however provide an example of how to do what I think you're trying to do and recommend that you rethink your approach in any case because this is almost as bad but I think it demonstrates that your problem was perhaps not one as much of scope but more of tokenization: letter2: func [b][foreach n ["sally" "sue"][print replace (copy b) 'name n]] greeting: ["hi" name "welcome back"] == ["hi" name "welcome back"] {I prefer not to overwrite REBOL words, like "form" from your example} == {I prefer not to overwrite REBOL words, like "form" from your example} name: "bob" == "bob" letter2 greeting hi sally welcome back hi sue welcome back FWIW, SS The self-modifying Bind-, or its non-self-modifying Bind/copy- variant approach really doesn't look preferrably to me. Here is an approach that looks different IMHO: letter2: func [b /local subst][ subst: func [name] reduce [:print b] foreach n ["sally" "sue"][subst n] ] greeting: ["hi" name "welcome back"] name: "bob" letter2 greeting What do you think? Ladislav On Thu, 7 Sep 2000 [EMAIL PROTECTED] wrote: letter2: func [b /local name] [foreach n ["sally" "sue"][ name: n print reform reduce b] ] form == ["hi" name "welcome back"] name == "bob" letter2 form hi bob welcome back hi bob welcome back ... the only problem is I was hoping that the loop values in letter2 would take precedence over the globally bound value of name and allow me to create a form letter of sorts. Could anyone help with this please? Get your FREE Email and Voicemail at Lycos Communications at http://comm.lycos.com
[REBOL] stdout instead of print? Re:
Print DOES send data to stdout, but not if you're running in an interactive session. Create a file named testing.r (assuming you're in a *nix/*nux environment, as you asked about piping and date) which reads as follows (not including the hyphen-bar delimiters: = #!/usr/local/bin/rebol -sq REBOL [] ; set this variable however you wish... date-string: "0907225000" print "this" print "is" print "a" print "test" print date-string = The first line may need to be different on your system, depending on where you have installed REBOL. Now, at the shell, enter the commands = chmod 744 testing.r ./testing.r ./testing.r | sort = The first command makes the file executable. The second should produce the output: = this is a test 0907225000 = The second should produce the output: = 0907225000 a is test this = That's how to pipe from REBOL to another process. Having said all that... You can only set the date on your system as root. Where is the script getting the value of date-string from? I'm just highly puzzled as to the use (and safety) of the exact example you asked about. -jn- [EMAIL PROTECTED] wrote: howdy guys, print date-string ==0907225000 Instead of printing date-string, how can I get it to stdout, so I can pipe it to date? -- Spend less time composing sigs. -tom
[REBOL] I give up Re:(5)
Is this line "prefix: make object! [full: nick: user: host: string!]" supposed to be replaced with the actual nick user and host portions or is this proper syntax! Paul Tretter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, September 08, 2000 3:47 PM To: [EMAIL PROTECTED] Subject: [REBOL] I give up Re:(4) I've done a client too, it is available at http://www.algonet.se/~peoyli/RebIRC, but its code needs some more work.. I mostly wrote this to learn Rebol and the IRC protocol, and it was meant to be a bot that jumps into a channel and gets the userlist and leaves again (to make the channel's people's page more interesting).. My solution to the PING/PONG stuff was something like.. handle-irc-cmd: func [] [ switch/default/case irc/command reduce[ "PING" [ insert irc-port rejoin ["PONG " (first irc/params) newline] prin #"^G" ] ... with "irc" being an object which consists of irc-obj: make object! [ prefix: make object! [full: nick: user: host: string!] command: string! params: block! ] (as described in the RFC) /PeO I've done a whole IRC client in REBOL, but not in position to release it in total. It was quite a while ago, so I need lots of head scratching to go back and figure things out... but will help if you're REALLY stuck. Russ
[REBOL] IRC Protocol (I give up ) Re:(6)
Is this line "prefix: make object! [full: nick: user: host: string!]" supposed to be replaced with the actual nick user and host portions or is this proper syntax! Paul Tretter I use this object to store a parsed RAW line from the IRC server (a call to a parse-irc-str function I wrote for this purpose). 'full' contains the whole prefix from the string sent by the server, and the rest of the prefix object contains the actual parts of the prefix. From the RFC: Each IRC message may consist of up to three main parts: the prefix (optional), the command, and the command parameters (of which there may be up to 15). The prefix, command, and all parameters are separated by one (or more) ASCII space character(s) (0x20). The presence of a prefix is indicated with a single leading ASCII colon character (':', 0x3b), which must be the first character of the message itself. ... message ::= [':' prefix SPACE ] command params crlf prefix ::= servername | nick [ '!' user ] [ '@' host ] It could be nice to have a REBOL function to actually parse (any) whole 'pseudo' BNF formatted description.. /PeO
[REBOL] Second request for help: globbing on a block of filenames Re:(3)
Hi, Oops, it occurs to me that I forgot to add the tail refinement to my first find (meaning a file feeder~fodder.r~ would be missed for example). This should work better: has-backup-file?: func [ {Returns true if any item in block ends with r~} arg [block!] ][ forall arg [ if (result: find/tail first arg "r~") [ if (length? result) = 2 [ return true ] ] ] return false ] Later, Stephen You could also use the empty? function if you wanted has-backup-file?: func [ {Returns true if any item in block ends with r~} arg [block!] /local result ][ forall arg [ if all [ result: find/last/tail first arg "r~" empty? result ][ return true ] ] false ] Julian Kinraid
[REBOL] printing a path and its value Re:
I want to print a path (ie, what the path is) and then the value of that path... how can I do so? Example: [ [system [ [schemes [ [ftp [ [passive "Passive ftp" [proxy [ [host "proxy host" [port-id "proxy port-id" [type "proxy type" [] [] [] [] [] == [ system [ schemes [ ftp [ passive "Passive ftp" proxy [ ... Paths: [ [Example/system/schemes/ftp/passive [] == [ Example/system/schemes/ftp/passive ] foreach Path Paths [print [:Path ":::" Path]] Example/system/schemes/ftp/passive ::: Passive ftp I hope that helps! Andrew Martin On the path to recovery... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] Trying to compose a block out of global and local bindings Re:(2)
Oh my god. I think this is the most naive thing I have ever done in my life... I really didnt even think that I had just redefined form. This is so embarrassing. --- On Fri, 8 Sep 2000 0:05 +020 alex.pini wrote: - Open Your Mind - Quoting from [EMAIL PROTECTED]'s message (07-Sep-00 22:02:43). p letter2: func [b /local name] [foreach n ["sally" "sue"][ name: n print reform reduce b] ] p p form p == ["hi" name "welcome back"] p p name p == "bob" p p letter2 form p hi bob welcome back p hi bob welcome back p p ... the only problem is I was hoping that the loop values in letter2 would take precedence over the globally bound value of name and allow me to create a form letter of sorts. p p Could anyone help with this please? letter2: func [b /local name] [foreach n ["sally" "sue"][ name: n print bind b 'name] ] Note that I don't really believe I've understood this myself. :-9 Also note you've just redefined the *form* native function... Alessandro Pini ([EMAIL PROTECTED]) "I'm just the... *shadow* of my former self." (Morden) Get your FREE Email and Voicemail at Lycos Communications at http://comm.lycos.com
[REBOL] Trying to compose a block out of global and local bindings Re:(3)
princepawn wrote: Oh my god. I think this is the most naive thing I have ever done in my life... I really didn't even think that I had just redefined form. This is so embarrassing. Don't be too embarrassed. I did a similar thing in my HTML dialect, and accidentally redefined 'head. Took me a while to figure out that. Best hint to avoid this problem is to use long descriptive names. Instead of 'form, use: 'form_letter. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --