[REBOL] Trying to compose a block out of global and local bindings Re:

2000-09-07 Thread rebol

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 

[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(4)

2000-09-07 Thread norsepower

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] eScribe Rebol Archive vs rebol.org Archive Re:(4)

2000-09-07 Thread Petr . Krenzelok



[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] Example ports Re:(3)

2000-09-07 Thread rebol

Hi Paul,

thanks. 

I believe http://www.rebol.com/users/netports.html explains the whole thing
quite well.

Specifically check

http://www.rebol.com/users/netports.html#ExchangingMessages

"Note that the sender port must be closed before the listening port will
collect the message and make it available to the print function"


At 07:50 PM 9/7/00 -0500, you wrote:
>Elan,
>
>   This is fantastic information.  This is exactly the kind of information
>that should go in the docs.  Anyone second the motion?  Makes it much
>plainer to understand.  I didnt know about the close after each send from
>the client.
>
>Paul Tretter
>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 07, 2000 6:36 PM
>To: [EMAIL PROTECTED]
>Subject: [REBOL] Example ports Re:
>
>
>Hi Paul,
>
>Assume two REBOL processes (i.e. you launch REBOL twice on the same
>machine, or on two different machines connected by TCP/IP. I assume same
>machine here and use local host setting, 127.0.01 for the client.)
>
>REBOL process 1: will be indicated by prompt 1>>
>REBOL process 2: will be indicated by prompt 2>>
>
>Simple Session:
>
>1>> server: open/lines tcp://:8000
>
>2>> client: open/lines tcp://127.0.0.1:8000
>2>> insert client "Hi, there."
>2>> close client
>
>1>> port: first server
>1>> print first port
>Hi, there.
>
>BETTER use copy to prevent data loss on server side:
>
>1>> port: first server
>1>> print copy port
>Hi, there.
>
>
>Complex (Bi-directional) Session:
>
>1>> server: open tcp://:8000
>1>> input-buffer: make string! 1024
>1>> while [true] [
>1>>   server-port: first server
>1>>   while [true] [
>1>> wait server-port
>1>> read-io server-port input-buffer 1024
>1>> break
>1>>   ]
>1>>   print input-buffer
>1>>   insert server-port join input-buffer [" from server."]
>1>>   clear input-buffer
>1>>   close server-port
>1>> ]
>
>
>
>2>> message:" Client here. "
>2>> client: open tcp://127.0.0.1:8000
>2>> insert client message
>2>> print copy client
>2>> close client
>
>Note that once you have sent something on a client port, you must close the
>client port and open it again, before you can send more stuff out that port.
>
>
>
>At 05:27 PM 9/7/00 -0500, you wrote:
>>Can someone provide an example of sending something to a port and how to
>>know if you are getting a response.
>>
>>Paul Tretter
>>
>>
>>
>
>;- Elan [ : - ) ]
>author of REBOL: THE OFFICIAL GUIDE
>REBOL Press: The Official Source for REBOL Books
>http://www.REBOLpress.com
>visit me at http://www.TechScribe.com
>
>
>
>

;- Elan [ : - ) ]
author of REBOL: THE OFFICIAL GUIDE
REBOL Press: The Official Source for REBOL Books
http://www.REBOLpress.com
visit me at http://www.TechScribe.com





[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(3)

2000-09-07 Thread allen

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] Copyrights

2000-09-07 Thread cgamayo

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] stdout instead of print?

2000-09-07 Thread balayo

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] Re: eScribe Rebol Archive vs rebol.org Archive Re:

2000-09-07 Thread alanwall

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:

2000-09-07 Thread norsepower

Here is info from the FAQ...

We currently support reading in past archives from the following formats:

Eudora 
Outlook Express 
UNIX mail 
Pegaus Mail 
ListSTAR 
Listserv archives 
Majordomo digests 

Even if your archive is in a different format, we might be able to import it. 
The imported messages will look like any other messages, and 
will therefore also be searchable.

OK. Can someone tell me how to get the entire archive?

-Ryan

>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.




[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:

2000-09-07 Thread norsepower

>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?)

-Ryan




[REBOL] Example ports Re:(2)

2000-09-07 Thread ptretter

Elan,

This is fantastic information.  This is exactly the kind of information
that should go in the docs.  Anyone second the motion?  Makes it much
plainer to understand.  I didnt know about the close after each send from
the client.

Paul Tretter


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 07, 2000 6:36 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Example ports Re:


Hi Paul,

Assume two REBOL processes (i.e. you launch REBOL twice on the same
machine, or on two different machines connected by TCP/IP. I assume same
machine here and use local host setting, 127.0.01 for the client.)

REBOL process 1: will be indicated by prompt 1>>
REBOL process 2: will be indicated by prompt 2>>

Simple Session:

1>> server: open/lines tcp://:8000

2>> client: open/lines tcp://127.0.0.1:8000
2>> insert client "Hi, there."
2>> close client

1>> port: first server
1>> print first port
Hi, there.

BETTER use copy to prevent data loss on server side:

1>> port: first server
1>> print copy port
Hi, there.


Complex (Bi-directional) Session:

1>> server: open tcp://:8000
1>> input-buffer: make string! 1024
1>> while [true] [
1>>   server-port: first server
1>>   while [true] [
1>> wait server-port
1>> read-io server-port input-buffer 1024
1>> break
1>>   ]
1>>   print input-buffer
1>>   insert server-port join input-buffer [" from server."]
1>>   clear input-buffer
1>>   close server-port
1>> ]



2>> message:" Client here. "
2>> client: open tcp://127.0.0.1:8000
2>> insert client message
2>> print copy client
2>> close client

Note that once you have sent something on a client port, you must close the
client port and open it again, before you can send more stuff out that port.



At 05:27 PM 9/7/00 -0500, you wrote:
>Can someone provide an example of sending something to a port and how to
>know if you are getting a response.
>
>Paul Tretter
>
>
>

;- Elan [ : - ) ]
author of REBOL: THE OFFICIAL GUIDE
REBOL Press: The Official Source for REBOL Books
http://www.REBOLpress.com
visit me at http://www.TechScribe.com





[REBOL] eScribe Rebol Archive vs rebol.org Archive

2000-09-07 Thread rsnell

A while back Ryan added this Rebol list to the eScribe site.
This is my opinion on the better archive (so don't get mad
anyone - it's just my opinion...)

My suggestion to those wanting answers (and knowing you have
seen it posted but can't remember when) is to first start with
the eScribe archive.  It is organized better, and its searches
appear to be faster and more accurate than those on rebol.org.

I just spent about a half hour on rebol.org looking for a post
that had the password syntax for email addresses since I knew
I'd seen that before (it's user:pass@domain).  I never found it
(and there are multiple ones).  I found the same info on eScribe
in less than a minute!

The biggest disadvantage with eScribe is that it doesn't have 
messages older than July 6, 2000.

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.

My 2 Cents.

BTW, eScribe Rebol Archive is at:
http://www.escribe.com/internet/rebol/

Thanks for putting that together Ryan!

Rodney




[REBOL] Network Port Reading Problem Re:(3)

2000-09-07 Thread holger

On Thu, Sep 07, 2000 at 04:42:53PM -0700, [EMAIL PROTECTED] wrote:
> >> wait c 1   ;should return after 1 second because there is no more data
> / (never returns from waiting)

Try wait [c 1]

-- 
Holger Kruse
[EMAIL PROTECTED]




[REBOL] Network Port Reading Problem Re:(2)

2000-09-07 Thread rsnell

Thanks Holger.  I'll try the xper but I really need to stick
with a stable release at this point.  It looks like I can use
the /binary refinement and copy/part to get the data and that
should work for now.

One possible problem I saw though.  I want to check whether there
is data waiting on the port before trying to copy.  I see the 
users guide says to use 'wait like [wait c 1] to wait on 
port c for 1 second.  However, if I do the following:

>> c: open/binary tcp://host:23
>> print copy/part c 100
>> #{FFFD18FFFD1D23FFFD27FFFD24}
>> wait c 1   ;should return after 1 second because there is no more data
/ (never returns from waiting)

It doesn't seem like wait is working correctly.

Basically I need something like the select() socket function.
Am I doing the right thing here?

Thanks again,
 
Rodney


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 07, 2000 3:47 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Network Port Reading Problem Re:


On Thu, Sep 07, 2000 at 03:18:38PM -0700, [EMAIL PROTECTED] wrote:
> I need to implement a telnet client in Rebol for a fixed task (that is, I
> don't
> want a terminal type thing - all client commands are fixed and will be run
> with no user interaction).

Try something like this. Only works with current experimental versions of
REBOL (www.rebol.com/xpers/xpers.html) though.

peer: open/direct/binary/no-wait tcp://myhost:23

forever [
wait peer
input-data: copy peer
; Handle your data here and insert the response, e.g.
; insert peer #{fffc25}
; The following print is just an example...
print input-data
]

The direct/no-wait ensures that copy returns whatever data is available.
Without
it copy usually blocks until the peer signals end-of-file. The wait is
necessary
to avoid busy-looping on copy. If copy returns an empty series (#{}) then
this means
no data is available (should not happen after a wait). If copy returns none
then the
peer has closed the connection.

-- 
Holger Kruse
[EMAIL PROTECTED]




[REBOL] if any [not suffixes find suffixes find/last file "." ] [ Re:(4)

2000-09-07 Thread bhandley

Just a note.

There is an enhancement request for find so that it return values like
John's code suggests but without requiring the loop.

Brett.

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 08, 2000 3:00 AM
Subject: [REBOL] if any [not suffixes find suffixes find/last file "." ]
 Re:(3)


>
>
> Hi,
>
> Do you mean ...
> foreach file-name file-list [
> if find/any file-name "*.r" [ print join "found " file-name ]
> ]
>
> ?
>
> cheers, john
>
> I think it makes sense now... but: how could I use a wildcard such as the
> find/any wildcard to find the file, e.g.:
>
> find/any file-list "*.r"
>
>




[REBOL] Example ports Re:

2000-09-07 Thread rebol

Hi Paul,

Assume two REBOL processes (i.e. you launch REBOL twice on the same
machine, or on two different machines connected by TCP/IP. I assume same
machine here and use local host setting, 127.0.01 for the client.)

REBOL process 1: will be indicated by prompt 1>>
REBOL process 2: will be indicated by prompt 2>>

Simple Session:

1>> server: open/lines tcp://:8000

2>> client: open/lines tcp://127.0.0.1:8000
2>> insert client "Hi, there."
2>> close client

1>> port: first server
1>> print first port
Hi, there.

BETTER use copy to prevent data loss on server side:

1>> port: first server
1>> print copy port
Hi, there.


Complex (Bi-directional) Session:

1>> server: open tcp://:8000
1>> input-buffer: make string! 1024
1>> while [true] [
1>>   server-port: first server
1>>   while [true] [
1>> wait server-port
1>> read-io server-port input-buffer 1024
1>> break
1>>   ]
1>>   print input-buffer 
1>>   insert server-port join input-buffer [" from server."]  
1>>   clear input-buffer
1>>   close server-port
1>> ]



2>> message:" Client here. "
2>> client: open tcp://127.0.0.1:8000
2>> insert client message
2>> print copy client
2>> close client

Note that once you have sent something on a client port, you must close the
client port and open it again, before you can send more stuff out that port.



At 05:27 PM 9/7/00 -0500, you wrote:
>Can someone provide an example of sending something to a port and how to
>know if you are getting a response.
>
>Paul Tretter
>
>
>

;- Elan [ : - ) ]
author of REBOL: THE OFFICIAL GUIDE
REBOL Press: The Official Source for REBOL Books
http://www.REBOLpress.com
visit me at http://www.TechScribe.com





[REBOL] Network Port Reading Problem Re:

2000-09-07 Thread ptretter

Im having the same problem.  Need more information in the documentation
about actively exchange data as in telnet type connection.  Instead the docs
seem to just state how to insert and open a port or exchange a bit of
information.  I want to keep the active session and I cant see the data
coming from my connection.  I can see it with telnet and know its coming.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 07, 2000 5:19 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Network Port Reading Problem


I need to implement a telnet client in Rebol for a fixed task (that is, I
don't
want a terminal type thing - all client commands are fixed and will be run
with no user interaction).

Anyway, so I open up a telnet connection to the box of interest:

>> c: open tcp://192.168.15.233:23
>>

Cool.  Now in this particular case, the telnet server returns an IAC packet
asking me
to DO (telnet parlance) some option stuff.  My question is - how do I get
the data
that the server has sent me?  I try:

>> print copy c
. finally get network timeout

or

>> print first c
. finally get network timeout

In my sniffer I see that there IS definitely data sent to me over the open
telnet socket
and the telnet server is waiting for me to get it and respond.  If I sniff
the Win32 built-in
telnet client I see that the client do the right thing and respond to this
packet.

What am I not doing correct here to get this data?

TIA,

Rodney




[REBOL] Network Port Reading Problem Re:

2000-09-07 Thread holger

On Thu, Sep 07, 2000 at 03:18:38PM -0700, [EMAIL PROTECTED] wrote:
> I need to implement a telnet client in Rebol for a fixed task (that is, I
> don't
> want a terminal type thing - all client commands are fixed and will be run
> with no user interaction).

Try something like this. Only works with current experimental versions of
REBOL (www.rebol.com/xpers/xpers.html) though.

peer: open/direct/binary/no-wait tcp://myhost:23

forever [
wait peer
input-data: copy peer
; Handle your data here and insert the response, e.g.
; insert peer #{fffc25}
; The following print is just an example...
print input-data
]

The direct/no-wait ensures that copy returns whatever data is available. Without
it copy usually blocks until the peer signals end-of-file. The wait is necessary
to avoid busy-looping on copy. If copy returns an empty series (#{}) then this means
no data is available (should not happen after a wait). If copy returns none then the
peer has closed the connection.

-- 
Holger Kruse
[EMAIL PROTECTED]




[REBOL] Rebol resumes...?

2000-09-07 Thread webmaster

Hi.

Please send your resume for possible near future freelance/contract Rebol 
CGI programming and more.

send to:
[EMAIL PROTECTED]

This is in regard to http://www.audiopia.com

Thank You.

Hey if I had some time I would create a job board for rebol.  Maybe I will 
anyway.  :]




[REBOL] Trying to compose a block out of global and local bindings Re:

2000-09-07 Thread lmecir

Hi,

try this:

letter2: func [b] [foreach name ["sally" "sue"][print bind/copy b
'name]]
form: ["hi" name "welcome back"]
letter2 form

Regards
Ladislav

> >> 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] Re: Trying to compose a block out of global and local bindings

2000-09-07 Thread alex . pini

>- Open Your Mind -<



Quoting from my message (08-Sep-00 00:05:00).

a> Note that I don't really believe I've understood this myself. :-9

... Note that the ":-9" is due to a malfunctioning shift-key, I'm not that horny about 
being bound. :-)




Alessandro Pini ([EMAIL PROTECTED])

"For sex." "No! Oh... er, that, too!" (J. Dax & Quark)




[REBOL] Example ports

2000-09-07 Thread ptretter

Can someone provide an example of sending something to a port and how to
know if you are getting a response.

Paul Tretter




[REBOL] Network Port Reading Problem

2000-09-07 Thread rsnell

I need to implement a telnet client in Rebol for a fixed task (that is, I
don't
want a terminal type thing - all client commands are fixed and will be run
with no user interaction).

Anyway, so I open up a telnet connection to the box of interest:

>> c: open tcp://192.168.15.233:23
>>

Cool.  Now in this particular case, the telnet server returns an IAC packet
asking me
to DO (telnet parlance) some option stuff.  My question is - how do I get
the data
that the server has sent me?  I try:

>> print copy c
. finally get network timeout

or

>> print first c
. finally get network timeout

In my sniffer I see that there IS definitely data sent to me over the open
telnet socket
and the telnet server is waiting for me to get it and respond.  If I sniff
the Win32 built-in
telnet client I see that the client do the right thing and respond to this
packet.

What am I not doing correct here to get this data?

TIA,

Rodney




[REBOL] Re: Trying to compose a block out of global and local bindings

2000-09-07 Thread alex . pini

>- 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)




[REBOL] Trying to compose a block out of global and local bindings Re:

2000-09-07 Thread ssayer

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,





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] write does not return a value upon success. This is bad for try blocks Re:

2000-09-07 Thread joel . neely

You could "try" (groan ;-) something along the lines of

   m: not error? try [write ftp:... "hi there"]

which leaves m simply indicating success  (or failure) of the
attempted block.

-jn-

[EMAIL PROTECTED] wrote:
> 
> I am writing a script that will try 3 times to write a file and then fail, however, 
>I cant place a try block around the REBOL write statement because it does not return 
>anything upon success, thus I get an error that the word is not bound:
> 
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
> connecting to: 170.16.15.136
> ** User Error: Server error: tcp 530 Login incorrect..
> ** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"
> ; -- great: when write fails 'm is bound
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
> connecting to: 170.16.15.136
> ** Script Error: m needs a value.
> ** Where: m: try [write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi 
>there"]
> ; --- well this sucks. I cant get a return value upon success
> 
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com




[REBOL] Second request for help: globbing on a block of filenames Re:

2000-09-07 Thread joel . neely

One possible solution is:

  >> stuff: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ 
  [%lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r %dummy.ftp
  [%dummy2.ftp~ %readby.ftp]
  == [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~
   %lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r %dummy.ft...
  >> foreach thing stuff [
  [print [
  [thing "^-"
  [either parse/all thing [thru "r~"] ["pass"]["fail"]
  []
  []
  cast.r   fail
  feedback.r   fail
  ftp.rfail
  ftp.r~   pass
  instinet.r   fail
  instinet.r~  pass
  lconfig.rfail
  lconfig.r~   pass
  nntp.r   fail
  notes.html   fail
  rebdoc.r fail
  dummy.ftpfail
  dummy2.ftp~  fail
  readby.ftp   fail
  >>

This depends on the fact that the parse only succeeds if it can find
"r~"
and, in doing so, arrive at the end of the string.

HTH,

-jn-


[EMAIL PROTECTED] wrote:
> 
> I have a block which contains filenames. I would like to get a true or false value 
>back indicating whether or not there is a filename in the block that terminates with 
>a r~ extension.
> 
> Please show me how to do this.
> 
> >> a
> == [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r 
>%lconfig.r~ %nntp.r %notes.html %rebdoc.r
> %rebol.exe %re...
> 
> Could someone show me how to glob for feedback.r?
> 
> In other words, I want to say
> 
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com




[REBOL] Console port

2000-09-07 Thread ptretter

How can I open the console port from the script so that I can see what is
happening.




[REBOL] Trying to compose a block out of global and local bindings

2000-09-07 Thread princepawn

>> 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] Error msg from write ftp:// is completely inaccurate Re:

2000-09-07 Thread ssayer

Actually the error reported by the server indicates an error trying to
change the mode (permissions) of the file (secondary to the attempt to
create a file with different permissions then the one existing)... not
that the file doesn't exist per se. The error message is associated with
the error number per the RFC to cover a variety of errors changing modes.
In this case it could be elaborated as "No such file or directory with the
permissions specified by the write command."

Later,




On Thu, 7 Sep 2000 [EMAIL PROTECTED] wrote:

> >> write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/chmod-file %user.r
> connecting to: 170.16.15.136
> >> print read ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/
> connecting to: 170.16.15.136
> chmod-file file1 ofile rebol.r user.r
> ; --- then I telnet to server and chmod 000 chmod-file
> ; --- thus it is not readable, writeable, execable by anyone
> ; --- then I try to overwrite it via REBOL:
> >> write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/chmod-file %user.r
> connecting to: 170.16.15.136
> ** User Error: Server error: tcp 553 chmod-file: No such file or directory..
> ** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/chmod-file %user.r
> >>
> 
> ; --- as you can see, it is very bizarre for a write command to claim that a file on 
>the remote server does not exist. The real problem is that it cant overwrite the 
>file. But it did not report that.
> 
> But actually, this is not the fault of REBOL: when I did a manual FTP I got the same 
>brain-damaged error message.
> 
> But anyway, maybe this will be of help to someone who is trying things with FTP and 
>getting hard-to-believe results with a similar operation.
> 
> 
> 
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com
> 
> 




[REBOL] Second request for help: globbing on a block of filenames Re:(2)

2000-09-07 Thread ssayer

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


On Thu, 7 Sep 2000, S. Sayer wrote:

> This one and the one before won't work as asked because they'll return
> true for files with r~ anywhere in the name. Try this instead (off the top
> of my head):
> 
> 
> has-backup-file?: func [ 
>   {Returns true if any item in block ends with r~}
>   arg [block!]
> ][
>   forall arg [ 
>   if (result: find first arg "r~") [
>   if (length? result) = 2 [
>   return true
>   ]
>   ] 
>   ]
>   return false
> ]
> 
> 
> 
> On Thu, 7 Sep [EMAIL PROTECTED] wrote:
> > 
> > Hi,
> > 
> > Or even  -
> > test-for-ext: func [
> > "Search a block for items ending with the given string. Returns TRUE or
> > FALSE"
> > value [string!]
> > data [block!]
> > ] [
> > foreach item data [
> > if find/last item value [ return true ]
> > false
> > ]
> > ]
> > 
> > cheers, john
> > >
> > I have a block which contains filenames. I would like to get a true or
> > false value back indicating whether or not there is a filename in the block
> > that terminates with a r~ extension.
> > 
> > Please show me how to do this.
> > 
> > >> a
> > == [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r
> > %lconfig.r~ %nntp.r %notes.html %rebdoc.r
> > %rebol.exe %re...
> > 
> > Could someone show me how to glob for feedback.r?
> > 
> > In other words, I want to say
> > 
> > 
> > Get your FREE Email and Voicemail at Lycos Communications at
> > http://comm.lycos.com
> > 
> > 
> > 
> > 
> > 
> 
> 




[REBOL] Second request for help: globbing on a block of filenames Re:(2)

2000-09-07 Thread ssayer

This one and the one before won't work as asked because they'll return
true for files with r~ anywhere in the name. Try this instead (off the top
of my head):


has-backup-file?: func [ 
{Returns true if any item in block ends with r~}
arg [block!]
][
forall arg [ 
if (result: find first arg "r~") [
if (length? result) = 2 [
return true
]
] 
]
return false
]



On Thu, 7 Sep [EMAIL PROTECTED] wrote:
> 
> Hi,
> 
> Or even  -
> test-for-ext: func [
> "Search a block for items ending with the given string. Returns TRUE or
> FALSE"
> value [string!]
> data [block!]
> ] [
> foreach item data [
> if find/last item value [ return true ]
> false
> ]
> ]
> 
> cheers, john
> >
> I have a block which contains filenames. I would like to get a true or
> false value back indicating whether or not there is a filename in the block
> that terminates with a r~ extension.
> 
> Please show me how to do this.
> 
> >> a
> == [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r
> %lconfig.r~ %nntp.r %notes.html %rebdoc.r
> %rebol.exe %re...
> 
> Could someone show me how to glob for feedback.r?
> 
> In other words, I want to say
> 
> 
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com
> 
> 
> 
> 
> 




[REBOL] Error msg from write ftp:// is completely inaccurate

2000-09-07 Thread princepawn

>> write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/chmod-file %user.r
connecting to: 170.16.15.136
>> print read ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/
connecting to: 170.16.15.136
chmod-file file1 ofile rebol.r user.r
; --- then I telnet to server and chmod 000 chmod-file
; --- thus it is not readable, writeable, execable by anyone
; --- then I try to overwrite it via REBOL:
>> write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/chmod-file %user.r
connecting to: 170.16.15.136
** User Error: Server error: tcp 553 chmod-file: No such file or directory..
** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/chmod-file %user.r
>>

; --- as you can see, it is very bizarre for a write command to claim that a file on 
the remote server does not exist. The real problem is that it cant overwrite the file. 
But it did not report that.

But actually, this is not the fault of REBOL: when I did a manual FTP I got the same 
brain-damaged error message.

But anyway, maybe this will be of help to someone who is trying things with FTP and 
getting hard-to-believe results with a similar operation.



Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com




[REBOL] Second request for help: globbing on a block of filenames Re:

2000-09-07 Thread christmn



a: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r 
%instinet.r~ %lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r 
%rebol.exe]foreach file a [if find/match/any file "*.r~" [print ["found one: 
" :file]]]
 
OR
 
a: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r 
%instinet.r~ %lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r 
%rebol.exe]pattern: "*.r~"foreach file a [if find/match/any file pattern 
[print ["found one: " :file]]]
 
OR for looking directly at the systems 
directories

files: read %.pattern: "*.cgi"foreach file files [if 
find/match/any file pattern [print ["found one: " :file]]]found one: demo.cgifound one: printenv.cgifound one: 
webenv.cgifound one: test.cgifound one: man.cgifound one: 
fetchurl.cgifound one: hw2test.cgifound one: wx.cgifound one: 
reb_fetch.cgifound one: fxhtml.cgi
 

  - Original Message - 
  From: 
  [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, September 07, 2000 8:17 
  AM
  Subject: [REBOL] Second request for help: 
  globbing on a block of filenames
  I have a block which contains filenames. I would like to get a 
  true or false value back indicating whether or not there is a filename in the 
  block that terminates with a r~ extension.Please show me how to do 
  this.>> a== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r 
  %instinet.r~ %lconfig.r %lconfig.r~ %nntp.r %notes.html 
  %rebdoc.r%rebol.exe %re...Could someone show me how to glob for 
  feedback.r?In other words, I want to sayGet your FREE 
  Email and Voicemail at Lycos Communications athttp://comm.lycos.com


[REBOL] file extensions (was if any [find suffixes....)

2000-09-07 Thread balayo

howdy,

since we're already on the subject,

>Do you mean ...
>foreach file-name file-list [
>if find/any file-name "*.r" [ print join "found " file-name ]
>]

how 'bout a refinement which allows one to choose *only* "*.r" and not,
say, "*r.old" ?



--

Spend less time composing sigs.
-tom




[REBOL] write does not return a value upon success. This is bad for try blocks Re:

2000-09-07 Thread lmecir

Hi,

try this:

tries: 3
until [
set/any 'm try [write
ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"]
tries: tries - 1
any [tries = 0 unset? get/any 'm]
]

Regards
Ladislav

> I am writing a script that will try 3 times to write a file and then fail,
however, I cant place a try block around the REBOL write statement because
it does not return anything upon success, thus I get an error that the word
is not bound:
>
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r
"hi there" ]
> connecting to: 170.16.15.136
> ** User Error: Server error: tcp 530 Login incorrect..
> ** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi
there"
> ; -- great: when write fails 'm is bound
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r
"hi there" ]
> connecting to: 170.16.15.136
> ** Script Error: m needs a value.
> ** Where: m: try [write
ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"]
> ; --- well this sucks. I cant get a return value upon success
>
>
>
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com
>
>




[REBOL] write does not return a value upon success. This is bad for try blocks Re:(2)

2000-09-07 Thread bo


Try using printerror.r from www.rebol.org in the Script Library section.
You can send a disarmed error object to printerror and it will display
the error as REBOL would, but without exiting the application.

-Bo

On 7-Sep-2000/9:57:35-7:00, [EMAIL PROTECTED] wrote:
>This method works well...
>>> m: error? try [ write %test "test" ]
>== false
>>> m: error? try [ write test "test" ]
>== true
>
>This will elleviate the problem with nothing being returned from write...
>>> m: try [ write %test "test" none]
>== none
>
>But you will still have to capture the error...
>>> m: try [ write test "test" none]
>** Script Error: test has no value.
>** Where: write test "test" none
>
>I just know how to bottle it up and spit it out later...
>>> if error? m: try [ write test "test" none] [ print "error detected!" m ]
>error detected!
>** Script Error: test has no value.
>** Where: write test "test" none
>
>Maybe someone knows how to peel an error! apart?
>
>--Ryan
>
>"Life... Dont talk to me about life."  -A robot named Marvin
>
>[EMAIL PROTECTED] wrote:
>
>> I am writing a script that will try 3 times to write a file and then fail, however, 
>I cant place a try block around the REBOL write statement because it does not return 
>anything upon success, thus I get an error that the word is not bound:
>>
>> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
>> connecting to: 170.16.15.136
>> ** User Error: Server error: tcp 530 Login incorrect..
>> ** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"
>> ; -- great: when write fails 'm is bound
>> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" 
>]
>> connecting to: 170.16.15.136
>> ** Script Error: m needs a value.
>> ** Where: m: try [write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi 
>there"]
>> ; --- well this sucks. I cant get a return value upon success
>>
>> Get your FREE Email and Voicemail at Lycos Communications at
>> http://comm.lycos.com
>
-- 
   Bohdan "Bo" Lechnowsky
   REBOL  Adventure Guide
   REBOL Technologies 707-467-8000 (http://www.rebol.com)
Download the REBOL Messaging Language
   The Official Source for REBOL Books (http://www.REBOLpress.com)




[REBOL] write does not return a value upon success. This is bad for try blocks Re:

2000-09-07 Thread johnkenyon



Okay -  last one,

m: error? try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r
"hi there" ]

Does that help?

cheers, john

I am writing a script that will try 3 times to write a file and then fail,
however, I cant place a try block around the REBOL write statement because
it does not return anything upon success, thus I get an error that the word
is not bound:

>> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi
there" ]
connecting to: 170.16.15.136
** User Error: Server error: tcp 530 Login incorrect..
** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi
there"
; -- great: when write fails 'm is bound
>> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r
"hi there" ]
connecting to: 170.16.15.136
** Script Error: m needs a value.
** Where: m: try [write
ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"]
; --- well this sucks. I cant get a return value upon success



Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com







[REBOL] write does not return a value upon success. This is bad for try blocks Re:

2000-09-07 Thread ryanc

This method works well...
>> m: error? try [ write %test "test" ]
== false
>> m: error? try [ write test "test" ]
== true

This will elleviate the problem with nothing being returned from write...
>> m: try [ write %test "test" none]
== none

But you will still have to capture the error...
>> m: try [ write test "test" none]
** Script Error: test has no value.
** Where: write test "test" none

I just know how to bottle it up and spit it out later...
>> if error? m: try [ write test "test" none] [ print "error detected!" m ]
error detected!
** Script Error: test has no value.
** Where: write test "test" none

Maybe someone knows how to peel an error! apart?

--Ryan

"Life... Dont talk to me about life."  -A robot named Marvin

[EMAIL PROTECTED] wrote:

> I am writing a script that will try 3 times to write a file and then fail, however, 
>I cant place a try block around the REBOL write statement because it does not return 
>anything upon success, thus I get an error that the word is not bound:
>
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
> connecting to: 170.16.15.136
> ** User Error: Server error: tcp 530 Login incorrect..
> ** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"
> ; -- great: when write fails 'm is bound
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
> connecting to: 170.16.15.136
> ** Script Error: m needs a value.
> ** Where: m: try [write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi 
>there"]
> ; --- well this sucks. I cant get a return value upon success
>
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com




[REBOL] if any [not suffixes find suffixes find/last file "." ] [ Re:(3)

2000-09-07 Thread johnkenyon



Hi,

Do you mean ...
foreach file-name file-list [
if find/any file-name "*.r" [ print join "found " file-name ]
]

?

cheers, john

I think it makes sense now... but: how could I use a wildcard such as the
find/any wildcard to find the file, e.g.:

find/any file-list "*.r"





[REBOL] if any [not suffixes find suffixes find/last file "." ] [ Re:(2)

2000-09-07 Thread princepawn

I think it makes sense now... but: how could I use a wildcard such as the find/any 
wildcard to find the file, e.g.:

find/any file-list "*.r"


---




On Thu, 7 Sep 2000 8:57:15 -  
 johnkenyon wrote:
>
>
>Hi again,
>
>Look at
>>> help any
>
>Maybe more readable with extra brackets to emphasize the execution order -
>if any [not suffixes find suffixes find/last file "."] [  is the same
>as 
>if (not suffixes) or (find suffixes (find/last file "."))] [
>
>Any better?
>
>cheers, john
>
>
>I am trying to understand the following script and dont quite understand
>the mechanics of this line right here:
>
>if any [not suffixes find suffixes find/last file "."] [
>
>I understand not suffixes completely
>
>I dont understand find suffixes find/last file "." at all
>
>suffixes is a block of suffixes, but I dont understand how all this works
>together, particularly. the "." part.
>
>
>


Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com




[REBOL] write does not return a value upon success. This is bad for try blocks

2000-09-07 Thread princepawn

I am writing a script that will try 3 times to write a file and then fail, however, I 
cant place a try block around the REBOL write statement because it does not return 
anything upon success, thus I get an error that the word is not bound:

>> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
connecting to: 170.16.15.136
** User Error: Server error: tcp 530 Login incorrect..
** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"
; -- great: when write fails 'm is bound
>> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
connecting to: 170.16.15.136
** Script Error: m needs a value.
** Where: m: try [write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi 
there"]
; --- well this sucks. I cant get a return value upon success



Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com




[REBOL] if any [not suffixes find suffixes find/last file "." ] [ Re:

2000-09-07 Thread johnkenyon



Hi again,

Look at
>> help any

Maybe more readable with extra brackets to emphasize the execution order -
if any [not suffixes find suffixes find/last file "."] [  is the same
as 
if (not suffixes) or (find suffixes (find/last file "."))] [

Any better?

cheers, john


I am trying to understand the following script and dont quite understand
the mechanics of this line right here:

if any [not suffixes find suffixes find/last file "."] [

I understand not suffixes completely

I dont understand find suffixes find/last file "." at all

suffixes is a block of suffixes, but I dont understand how all this works
together, particularly. the "." part.





[REBOL] SMTP setup and cgi send? Re:(2)

2000-09-07 Thread christmn



You need to either define REBOL_HOME in the webserver somehow 
or put the USER.r file in the home directory of the owner of the cgi script. If 
the cgi is owned by nobody and nobody has no home directory (does not execute a 
login to read a profile anyway) then you need to put USER.r in the directory 
where the cgi script resides to be read by REBOL.

  - Original Message - 
  From: 
  [EMAIL PROTECTED] 
  
  To: [EMAIL PROTECTED] 
  Sent: Thursday, September 07, 2000 3:19 
  AM
  Subject: [REBOL] SMTP setup and cgi send? 
  Re:
  Well once again I solved my own problem.I 
  doset-net [[EMAIL PROTECTED] mail.domain.dom]before I need to 
  send somethingAt 03:46 AM 9/7/00 -0500, you wrote:>I have 
  my info in USER.r correct for smtp yet it does not work when I try 
  >sending email out via a cgi.>>what could be 
  wrong?>>thanks>>Jeff Rubin, CTO & 
  Co-Founder>Audiopia>Shutup and 
  Listen...>http://www.audiopia.com>also check out my personal 
  site Brainbyte!>http://www.brainbyte.comJeff Rubin, CTO & 
  Co-FounderAudiopiaShutup and Listen...http://www.audiopia.comalso check out 
  my personal site Brainbyte!http://www.brainbyte.com


[REBOL] Second request for help: globbing on a block of filenames Re:

2000-09-07 Thread johnkenyon



Hi,

Or even  -
test-for-ext: func [
"Search a block for items ending with the given string. Returns TRUE or
FALSE"
value [string!]
data [block!]
] [
foreach item data [
if find/last item value [ return true ]
false
]
]

cheers, john
>
I have a block which contains filenames. I would like to get a true or
false value back indicating whether or not there is a filename in the block
that terminates with a r~ extension.

Please show me how to do this.

>> a
== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r
%lconfig.r~ %nntp.r %notes.html %rebdoc.r
%rebol.exe %re...

Could someone show me how to glob for feedback.r?

In other words, I want to say


Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com







[REBOL] Second request for help: globbing on a block of filenames Re:

2000-09-07 Thread johnkenyon



Hi,

Try  -
test-for-ext: func [
"Search a block for items ending with the given string. Returns TRUE or
FALSE"
value [string!]
data [block!]
] [
foreach item data [
if find/reverse tail item value [ return true ]
false
]
]

cheers, john
>
I have a block which contains filenames. I would like to get a true or
false value back indicating whether or not there is a filename in the block
that terminates with a r~ extension.

Please show me how to do this.

>> a
== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r
%lconfig.r~ %nntp.r %notes.html %rebdoc.r
%rebol.exe %re...

Could someone show me how to glob for feedback.r?

In other words, I want to say


Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com







[REBOL] if any [not suffixes find suffixes find/last file "."] [

2000-09-07 Thread princepawn

I am trying to understand the following script and dont quite understand the mechanics 
of this line right here:

if any [not suffixes find suffixes find/last file "."] [

I understand not suffixes completely

I dont understand find suffixes find/last file "." at all

suffixes is a block of suffixes, but I dont understand how all this works together, 
particularly. the "." part.

REBOL [
Title: "Delete Files by Suffix"
Date: 7-July-2000
File: %delete-suffix.r
Author: "Reburu"
Purpose: {
Delete files based on their suffixes.  Can also delete
deeply through all subdirectories.
}
Note: {Press ESCAPE to break out at the prompt.}
Category: [file util 3]
] delete-suffix: func [
"Delete files deeply by suffix."
dir-name "Starting directory"
suffixes "Block of suffixes or none"
/deep "Delete into subdirectories"
/sure "Do not verify the deletion"
][
if dir? dir-name [
dir-name: dirize dir-name
;print ["Inspecting:" dir-name]
foreach file read dir-name [
either dir? dir-name/:file [
if deep [
either sure [
delete-suffix/deep/sure dir-name/:file suffixes
][
delete-suffix/deep dir-name/:file suffixes
]
]
][
if any [not suffixes find suffixes find/last file "."] [
if any [
sure
confirm ["Delete" dir-name/:file "? "]
][
print ["Deleting:" dir-name/:file]
delete dir-name/:file
]   ]   ]   ]   ]   ] ;Examples:
;delete-suffix %. none  ; delete all files
;delete-suffix/deep %. [%.jpg %.gif %.bmp]  ; delete image files
;delete-suffix/deep %msvc [%.sbr %.obj %.pdb %.ilk %.pch %.bsc %.idb]
delete-suffix/deep/sure %. [%.err]  ; delete all error files for s


Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com




[REBOL] Second request for help: globbing on a block of filenames

2000-09-07 Thread princepawn

I have a block which contains filenames. I would like to get a true or false value 
back indicating whether or not there is a filename in the block that terminates with a 
r~ extension.

Please show me how to do this.

>> a
== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r %lconfig.r~ 
%nntp.r %notes.html %rebdoc.r
%rebol.exe %re...

Could someone show me how to glob for feedback.r?

In other words, I want to say


Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com




[REBOL] email-proxy in rebol?

2000-09-07 Thread agem



i would like a email proxy, which protocolls my outgoing emails.
lots of programms have inbuild mailers (netscape staroffice rebol-feedback..),
and i loose all this nice self-written messages :(

with a proxy i could collect them somewhere in a real searchable fashion
and have this "quick reply" - feature too.

well, proxying the input would be cool too.

How can i handle that? (REBOL preferred :)

Volker




[REBOL] How do convert binary and decompress compression? Re:

2000-09-07 Thread allen


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 07, 2000 11:13 PM
Subject: [REBOL] How do convert binary and decompress compression?


> How do you convert binary back to ascii?
>
> How do you decompress something that is compressed?

You should try and use 'help and 'what a bit more, they can help you find
functions and and find out what they do.
e.g If I wanted to know how to decompress, I would type.
>> ? decompress

Help also works with searches on data types e.g
to return a list of functions you can use
>> what
or
>> ? function!

It also matches partial words e.g
>> ? comp
Found these words:
 complement (action)
 compose(native)
 compress   (native)
 decompress (native)

To find a list of conversion functions try this
>> ? to-

You will be surprised how many questions REBOL can answer for you.

Cheers,

Allen K








[REBOL] How do convert binary and decompress compression?

2000-09-07 Thread princepawn

How do you convert binary back to ascii?

How do you decompress something that is compressed?
---


On Tue, 5 Sep 2000 11:31:11   
 ryanc wrote:
>With REBOL you wont be too successful hiding this from a REBOL
>programmer, because of course a properly placed probe would easily
>reveal it no matter how much encryption you threw at it.
>
>So basically all you can do is keep it from being non-programmer
>readable in a file.  The easiest way to this is with to-binary:
>
>>> password: "password"
>== "password"
>>> to-binary password
>== #{70617373776F7264}
>
>This is a little too obvious to me though, maybe compress:
>
>>> compress password
>== #{789C2B482C2E2ECF2F4A01000F9103740800}
>
>Or lastly if your space conscious:
>
>>> forall password [change password to-char xor 85 first password]
>== false
>>> head password
>== {%4&&":'1}
>
>--Ryan
>
>[EMAIL PROTECTED] wrote:
>
>> howdy list,
>>
>> There have been several posts on encryption lately.  I'd
>> like to be able to encrypt a local password file to call on
>> when constructing ftp urls.  I don't want to hard-code them
>> into scripts, and I'm already tired of
>>
>> ;pass: ask/hide "password? "
>>
>> I also don't like to have my passwords floating around my drive
>> in plain text.
>>
>> How do you  guys handle this?
>>
>> thanks
>> --
>>
>> Eat more spinach.
>> -tom
>
>--
>
>* Ryan Cole *
>Programmer Analyst
>www.iesco-dms.com
>707-468-5400
>
>;Fortuneately escape will cancel this endless loop...
>Forever [ buy microsoft version: version + 1 ]
>
>
>


Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com




[REBOL] SMTP setup and cgi send? Re:

2000-09-07 Thread webmaster

Well once again I solved my own problem.

I do

set-net [[EMAIL PROTECTED] mail.domain.dom]

before I need to send something


At 03:46 AM 9/7/00 -0500, you wrote:
>I have my info in USER.r correct for smtp yet it does not work when I try 
>sending email out via a cgi.
>
>what could be wrong?
>
>thanks
>
>Jeff Rubin, CTO & Co-Founder
>Audiopia
>Shutup and Listen...
>http://www.audiopia.com
>also check out my personal site Brainbyte!
>http://www.brainbyte.com

Jeff Rubin, CTO & Co-Founder
Audiopia
Shutup and Listen...
http://www.audiopia.com
also check out my personal site Brainbyte!
http://www.brainbyte.com




[REBOL] Management app??

2000-09-07 Thread vkmodgil

Hi,
Just wondering if anyone has done any work in snmp
based management app using Rebol?? 
Vivek

__
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/




[REBOL] Testing Brando Re:

2000-09-07 Thread Al . Bri

Don't worry about Brando. He's great! :-)
The problem lies in _one_ of the several mta at my local ISP. This one
mta is set to yesterday's date and so causes my email to apparently vanish,
when sorted by date.

Andrew Martin
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-




[REBOL] SMTP setup and cgi send?

2000-09-07 Thread webmaster

I have my info in USER.r correct for smtp yet it does not work when I try 
sending email out via a cgi.

what could be wrong?

thanks

Jeff Rubin, CTO & Co-Founder
Audiopia
Shutup and Listen...
http://www.audiopia.com
also check out my personal site Brainbyte!
http://www.brainbyte.com




[REBOL] Testing Brando - please delete this

2000-09-07 Thread Al . Bri


Andrew Martin
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-