[REBOL] Rebol von Neumann properties (RIP ifs-for-whomever cont.) Re:(3)

2000-10-17 Thread lmecir

Hi,

 If I understand your use of the term "evolving language" correctly,
 back in the 70's we used the term "extensible language" for the same
 thing (or something quite similar).  That term implied that the
 programmer could:

 *  add new syntactical structures (notation),
 *  add new control structures,
 *  create new datatypes and associated operations, and that
having done so,
 *  the extended language would appear as a whole language, without
obvious "seams" between the core language and the extensions, and
 *  there should not be a significant performance penalty for using
the extensions.

Extensible Language seems perfect.

  I don't think, that an Evolving Language must be able to do
  something like:
 
  a: [append a [+ 1] 1]
  do a
 
  (a von Neumann property - Pure Self Modifying Code), but I do
  think, that an Evolving language must be able to do:
 
  a: create-a-translation-of something
  do a
 
  , which may be described as a von Neumann property of the language
  too, but this is a code I would like to describe as a provision to
  understand Something with new syntactic/semantic rules (a new
  dialect, if you like, but it might not be a new dialect, but a new
  stage of the original language evolution).
 

 I believe I understand the distinction you're drawing here, but I
 must confess that I don't yet grasp HOW to enforce it without either
 performance penalties or loss of introspection.  For example, if I
 imagine something like

 active-thing: load-to-read-only-code data-representation
 do active-thing

 ALONG WITH the ability to introspect

 interesting-property: obtain-state active-thing selector

 then wouldn't I be able to do this

 altered-property: mutate interesting-property
 active-thing: load-to-read-only-code replace/all
   interesting-property altered-property
 do active-thing

 and be right back with self-modification, albeit at a severely
 lowered performance?

 Have I missed something?


The performance subject is very questionable, IMHO. I would call your sample
a WYSIWYG code. Let's try to compare it with Pure SMC like:

a: [append a [+ 1] 1]
do a

Don't you see any difference? If I would like to do it in a WYSIWYG fashion,
I would have to write:

a: [append a [+ 1] 1]
do copy a

Let's compare the results:

the first case:
 a: [append a [+ 1] 1]
== [append a [+ 1] 1]
 do a
== 1
 do a
== 2
 do a
== 3
 do a
== 4
 do a
== 5
 do a
== 6
 do a
== 8

the second one:

 a: [append a [+ 1] 1]
== [append a [+ 1] 1]
 do copy a
== 1

 do copy a
== 2
 do copy a
== 3
 do copy a
== 4
 do copy a
== 5
 do copy a
== 6
 do copy a
== 7
 do copy a
== 8
 do copy a
== 9
 do copy a
== 10


Regards
Ladislav




[REBOL] Port probing Re:(2)

2000-10-17 Thread ptretter

Thanks Holger for the great feedback.  I am gonna test this shortley to see
if it accomplishes what I'm trying to do. I will post to the list what I
find.

Paul Tretter


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 10:42 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Port probing Re:


On Mon, Oct 16, 2000 at 10:12:13PM -0500, [EMAIL PROTECTED] wrote:
 If I have to ports that I wait for data on how can I put them in a while
or
 forever loop without locking up the console.  If I had a if statement
 testing data received.

That depends on the type of port and the version of REBOL you use. Assuming
tcp, udp or serial ports opened with /direct, you can wait for multiple
ports
with

wait [port1 port2]

which returns one of the ports if it has data, none otherwise. To get a
block
of all ports returned instead of just a single port use wait/all (latest
experimental version only).

To just poll ports without blocking add a timeout of zero, i.e. try

wait [port1 port2 0]

Using a timeout of zero to poll only works with some old (pre-2.3) versions
of REBOL (on some platforms) and with the latest experimental versions (on
all
platforms), but not with REBOL 2.3.

Other types of ports currently do not support 'wait. Higher-level network
ports (HTTP etc.) will probably support it in one of the next experimental
versions, when opened with /direct.

You may also want to look at the no-wait refinement for 'open. It
guarantees that 'copy on a port never blocks, even if there is no data
available on it (latest experimental version only).

--
Holger Kruse
[EMAIL PROTECTED]




[REBOL] Port probing Re:(2)

2000-10-17 Thread ptretter

How do you open a console as a port?

Paul Tretter

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 11:41 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Port probing Re:


 If I have two ports that I wait for data on how can I put them in a while
or forever loop without locking up the console.  If I had a if statement
testing data received.

How about opening the console as a port and include it in your wait? You'll
need to check after the 'wait, to see if the event was a key or stuff from
your other ports.

Andrew Martin
Turning it all inside out...
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
--





[REBOL] FW: Mathematical Operations in REBOL

2000-10-17 Thread doug . vos

A colleague forwarded this set of comments/questions to me
and I am forwarding to the REBOL list...

 When performing mathematical calculations, 
 I've come across some interesting results, particularly with the modular
 division ( // ) operation.
 
 For example, if I perform 
  e: 1.22 // 0.01 
 in REBOL, e will equal 9.92E-3. 
 Although the answer is 0.01, or 1E-2, I can type 
  e = 0.01 and true 
 
 will be returned.
 
 While accepting 9.92E-3 is sufficient in most cases, 
 I may be in trouble if I wanted to convert the value of e to a string, for
 example. 
 Is there anyway to make this calculation return display 1E-2 exactly?
 
 I am using REBOL/Core Version 2.3.0.3.1.
 
 Thanx,
 -C. Hampton




[REBOL] Port probing Re:(2)

2000-10-17 Thread ptretter

I tried play with this with this script while opening another console and
inserting to those ports.  I  got no expected output.  The core docs need to
be updated to explain listening on more than one port.

REBOL[]
port1: open tcp://:55
port2: open tcp://:56


while [true][
wait [port1 port2 0]
buffer1: first port1
buffer2: first port2
print buffer1
print buffer2
]

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 10:42 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Port probing Re:


On Mon, Oct 16, 2000 at 10:12:13PM -0500, [EMAIL PROTECTED] wrote:
 If I have to ports that I wait for data on how can I put them in a while
or
 forever loop without locking up the console.  If I had a if statement
 testing data received.

That depends on the type of port and the version of REBOL you use. Assuming
tcp, udp or serial ports opened with /direct, you can wait for multiple
ports
with

wait [port1 port2]

which returns one of the ports if it has data, none otherwise. To get a
block
of all ports returned instead of just a single port use wait/all (latest
experimental version only).

To just poll ports without blocking add a timeout of zero, i.e. try

wait [port1 port2 0]

Using a timeout of zero to poll only works with some old (pre-2.3) versions
of REBOL (on some platforms) and with the latest experimental versions (on
all
platforms), but not with REBOL 2.3.

Other types of ports currently do not support 'wait. Higher-level network
ports (HTTP etc.) will probably support it in one of the next experimental
versions, when opened with /direct.

You may also want to look at the no-wait refinement for 'open. It
guarantees that 'copy on a port never blocks, even if there is no data
available on it (latest experimental version only).

--
Holger Kruse
[EMAIL PROTECTED]




[REBOL] FW: Mathematical Operations in REBOL Re:

2000-10-17 Thread rebol

Hi Doug,

go to http://www.rebol.org/math/index.html and pick up a copy of Eric Long's
decimal.r. He writes:
Purpose: Contains functions for the manipulation of decimal values, packaged
into the REAL object. These provide full support for native binary
floating-point file IO, compatible with C,
   FORTRAN, etc. REBOL decimal and money values may also be saved and
loaded with no roundoff error. This package is necessary because the standard
REBOL representation of
   decimal values may round off one or two significant digits, and the
rounding of money values is an even greater source of error. This script
contains two more objects, IEEE and
   EMPIRICAL, which provide several functions useful for exploring how
decimal values are represented as double floating point numbers, and for
testing the inexactness of the REBOL
   comparison functions.

Direct download link:
http://www.rebol.org/math/decimal.r

This may be exactly what your friend is looking for.

Elan

[EMAIL PROTECTED] wrote:

 A colleague forwarded this set of comments/questions to me
 and I am forwarding to the REBOL list...

  When performing mathematical calculations,
  I've come across some interesting results, particularly with the modular
  division ( // ) operation.
 
  For example, if I perform
   e: 1.22 // 0.01
  in REBOL, e will equal 9.92E-3.
  Although the answer is 0.01, or 1E-2, I can type
   e = 0.01 and true
 
  will be returned.
 
  While accepting 9.92E-3 is sufficient in most cases,
  I may be in trouble if I wanted to convert the value of e to a string, for
  example.
  Is there anyway to make this calculation return display 1E-2 exactly?
 
  I am using REBOL/Core Version 2.3.0.3.1.
 
  Thanx,
  -C. Hampton




[REBOL] Port probing Re:(3)

2000-10-17 Thread jschuhr

How does the "view" function handle calls to other functions?  I have the 
following scenario:

testserver.r
+
REBOL [
title "Test Server"
]

system/console/busy: none

start-server: func [] [
server-port: open tcp://:8001
forever [
connection-port: first server-port
wait connection-port
data-recvd: copy connection-port
if data-recvd  none [
print data-recvd
]
close connection-port
clear data-recvd
wait 00:00:01
]
]

view layout [
button "Startup" [start-server]
button "Shutdown" [quit]
size 200x200
]
+EOF---


testclient.r
+--
REBOL []

send-message: :save

view layout [
button "Send message" [
send-message tcp://localhost:8001 "Message test"
]
button "Exit" [quit]
]
+--EOF-

The testserver.r starts and the window shows up.  The user clicks on "Start 
server" and the server starts listening for messages.

The testclient.r starts up and the user and send test messages by
clicking on the button and as expected, the server displays the
messages.  However, at this point, REBOL/View isn't interactive
anymore for the testserver.r reblet.  How does blocking on a port
affect View and how can one listen on a port and maintain interactivity
in the window?

--John


From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: [REBOL] Port probing Re:(2)
Date: Tue, 17 Oct 2000 10:55:23 -0500

I tried play with this with this script while opening another console and
inserting to those ports.  I  got no expected output.  The core docs need 
to
be updated to explain listening on more than one port.

REBOL[]
port1: open tcp://:55
port2: open tcp://:56


while [true][
wait [port1 port2 0]
buffer1: first port1
buffer2: first port2
print buffer1
print buffer2
]

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 10:42 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Port probing Re:


On Mon, Oct 16, 2000 at 10:12:13PM -0500, [EMAIL PROTECTED] wrote:
  If I have to ports that I wait for data on how can I put them in a while
or
  forever loop without locking up the console.  If I had a if statement
  testing data received.

That depends on the type of port and the version of REBOL you use. Assuming
tcp, udp or serial ports opened with /direct, you can wait for multiple
ports
with

wait [port1 port2]

which returns one of the ports if it has data, none otherwise. To get a
block
of all ports returned instead of just a single port use wait/all (latest
experimental version only).

To just poll ports without blocking add a timeout of zero, i.e. try

wait [port1 port2 0]

Using a timeout of zero to poll only works with some old (pre-2.3) versions
of REBOL (on some platforms) and with the latest experimental versions (on
all
platforms), but not with REBOL 2.3.

Other types of ports currently do not support 'wait. Higher-level network
ports (HTTP etc.) will probably support it in one of the next experimental
versions, when opened with /direct.

You may also want to look at the no-wait refinement for 'open. It
guarantees that 'copy on a port never blocks, even if there is no data
available on it (latest experimental version only).

--
Holger Kruse
[EMAIL PROTECTED]


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.




[REBOL] Ports and system scaling ...

2000-10-17 Thread petr . krenzelok

Hi,

I would like to ask about possibility of REBOL system scalling. Let's assume
following scenario:

... main rebol session running script similar to Sterling's reb-proxy.r. The
script is storing connections in the block, running in loop and serving new
connection.

But - current aproach doesn't scale - how much connections is REBOL able to
handle in one session? Maybe better question is - how much connection is
effective to be handled by one task?

Now probably the most fundamental question comes - is ti possible to launch
new REBOL session (it is currently possible with 'launch function and will
be possible in future by planned rebol multitasking capabilities) and send
new session the connection to handle? E.g. - start new rebol session for
each incoming 10 connections.

Just curious,
Thanks,
-pekr-




[REBOL] Ports and system scaling ... Re:

2000-10-17 Thread ptretter

Could someone post a sample script of two ports listening as with all do
respect to Holger I just dont get it.  I tried different ideas and can't
seem to understand how.

Paul Tretter


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 17, 2000 1:27 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Ports and system scaling ...


Hi,

I would like to ask about possibility of REBOL system scalling. Let's assume
following scenario:

... main rebol session running script similar to Sterling's reb-proxy.r. The
script is storing connections in the block, running in loop and serving new
connection.

But - current aproach doesn't scale - how much connections is REBOL able to
handle in one session? Maybe better question is - how much connection is
effective to be handled by one task?

Now probably the most fundamental question comes - is ti possible to launch
new REBOL session (it is currently possible with 'launch function and will
be possible in future by planned rebol multitasking capabilities) and send
new session the connection to handle? E.g. - start new rebol session for
each incoming 10 connections.

Just curious,
Thanks,
-pekr-




[REBOL] Lesson #1 - Round to a number at any given place

2000-10-17 Thread gmassar

REBOL fella: 

Here is my first lesson for those who wish to do an exercise in order to
better understand REBOL. Old saying: the more practice, the better
programmer.

Write a function that performs rounding to a number at any given place.
Here are examples.

 to-round 123.45
== 123
 to-round 123.55
== 124
 to-round -123.45
== -123
 to-round/at 123.344 2
== 123.34
 to-round 123.345 2
== 123.35
 to-round/at 12345 -2
== 12300
 to-round/at (1.22 // .01) 2
== 1E-2

NOTE: the last one is to answer the earlier message on this list.

Send your answer to my email at [EMAIL PROTECTED], not to this list.
I'll reply with my solution. In a couple of days or so, I'll post the
best solution with its author.

Have fun!

Geo (old professor)




[REBOL] New to the PC

2000-10-17 Thread targhan

Hello All:

I've just got myself a windows machine.  My Amiga has had problems
(Simm sockets are messed up), so I was hoping someone would know of  a
good editor to use on Win95 (preferably free, as I hope to get my
Amiga back up soon).

Thanks to any and all that help!

Regards,
David C.

P.S. - Linux isn't an option, as my Bios is flooky on the pc.




[REBOL] FTP and Absolute Directories

2000-10-17 Thread cribbsj

Some time ago I posted a question asking how I could ftp to a server and go to
a directory that was not below my home directory.

For example, I would like to ftp to another server here at work, and get a file
located in /var/local/datamover/test1/.

The problem is that Rebol seems to only let you specify relative directory
paths below where you ftp in.

So, if I use the ftp command and specify my user id and password, it will only
let me reference a directory below my home directory.

Perl, using the Net::FTP object lets me ftp using an absolute path.  I'm hoping
someone out there has an idea how I can do this in Rebol.  I would really like
to write this application in Rebol instead of Perl.

Thanks in advance for the help!

-- 
Jamey Cribbs




[REBOL] New to the PC Re:

2000-10-17 Thread RChristiansen

Use EditPlus

http://www.editplus.com

It is shareware, but the demo is fully functional.

 Hello All:
 
 I've just got myself a windows machine.  My Amiga has had problems
 (Simm sockets are messed up), so I was hoping someone would know of  a
 good editor to use on Win95 (preferably free, as I hope to get my Amiga
 back up soon).
 
 Thanks to any and all that help!
 
 Regards,
 David C.
 
 P.S. - Linux isn't an option, as my Bios is flooky on the pc.
 





[REBOL] New to the PC Re:

2000-10-17 Thread doug . vos

Try the "free" editor at http://www.notetab.com/
especially nice if you are doing web pages


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 17, 2000 4:05 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] New to the PC


Hello All:

I've just got myself a windows machine.  My Amiga has had problems
(Simm sockets are messed up), so I was hoping someone would know of  a
good editor to use on Win95 (preferably free, as I hope to get my
Amiga back up soon).

Thanks to any and all that help!

Regards,
David C.

P.S. - Linux isn't an option, as my Bios is flooky on the pc.




[REBOL] FTP and Absolute Directories Re:

2000-10-17 Thread doug . vos

Did you try "../../path/path/path/goodfile.txt" ?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 17, 2000 3:01 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] FTP and Absolute Directories


Some time ago I posted a question asking how I could ftp to a server and go
to
a directory that was not below my home directory.

For example, I would like to ftp to another server here at work, and get a
file
located in /var/local/datamover/test1/.

The problem is that Rebol seems to only let you specify relative directory
paths below where you ftp in.

So, if I use the ftp command and specify my user id and password, it will
only
let me reference a directory below my home directory.

Perl, using the Net::FTP object lets me ftp using an absolute path.  I'm
hoping
someone out there has an idea how I can do this in Rebol.  I would really
like
to write this application in Rebol instead of Perl.

Thanks in advance for the help!

-- 
Jamey Cribbs




[REBOL] New to the PC Re:

2000-10-17 Thread kracik

Hi,

I use shareware GWD Text Editor (http://www.gwdsoft.com/)for REBOL
editing. I made a long list of predefined REBOL words, so it has a
crude form of syntax highlighting. But unfortunately it can't highlight
or escape {multiline {
"REBOL" ^}
strings} like this one correctly. It uses Microsoft's MFC library so
it's startup time is quite high. Other nice editor I have seen is
Edit+ (http://www.editplus.com/).

And, please, never use Windows Notepad. There are replacements that are
more powerful and shorter than Notepad itself, like Metapad
(http://welcome.to/metapad/)

But, I couldn't get really used to Windows or Linux editors, I still
miss the old Amiga CygnusEd and GoldEd :-(

hope this helps,

-- 
Michal Kracik


[EMAIL PROTECTED] wrote:
 
 Hello All:
 
 I've just got myself a windows machine.  My Amiga has had problems
 (Simm sockets are messed up), so I was hoping someone would know of  a
 good editor to use on Win95 (preferably free, as I hope to get my
 Amiga back up soon).
 
 Thanks to any and all that help!
 
 Regards,
 David C.
 
 P.S. - Linux isn't an option, as my Bios is flooky on the pc.




[REBOL] New to the PC Re:(2)

2000-10-17 Thread eric


Not to start a holy war, but I am partial to VIM myself

www.vim.org




[REBOL] FTP and Absolute Directories Re:(2)

2000-10-17 Thread cribbsj

Hey, that worked!

I did:

read
ftp://user:[EMAIL PROTECTED]/../../var/local/datamover/test1/testfile1

and it worked.

Thanks very much for the help!

On Tue, 17 Oct 2000, you wrote:
 Did you try "../../path/path/path/goodfile.txt" ?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 17, 2000 3:01 PM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] FTP and Absolute Directories
 
 
 Some time ago I posted a question asking how I could ftp to a server and go
 to
 a directory that was not below my home directory.
 
 For example, I would like to ftp to another server here at work, and get a
 file
 located in /var/local/datamover/test1/.
 
 The problem is that Rebol seems to only let you specify relative directory
 paths below where you ftp in.
 
 So, if I use the ftp command and specify my user id and password, it will
 only
 let me reference a directory below my home directory.
 
 Perl, using the Net::FTP object lets me ftp using an absolute path.  I'm
 hoping
 someone out there has an idea how I can do this in Rebol.  I would really
 like
 to write this application in Rebol instead of Perl.
 
 Thanks in advance for the help!
 
 -- 
 Jamey Cribbs
-- 
Jamey Cribbs
Sr. Technical Consultant




[REBOL] New to the PC Re:(2)

2000-10-17 Thread targhan

Hi,

Michal, I'll try the varius editors.  However, like I said before.. I'm
using this pc until I can get my Miggy fixed.  I don't think I can put up
with Outlook for very long, and I'll probably drop to my old 1200 on
occation anyway.  MD-2 is far cleaner than Outlook.

Can't wait to see who does a real emailer in REBOL!And, Thanks again.
Not just to you, but to everyone who replied!

regards,
David C.
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 17, 2000 5:26 PM
Subject: [REBOL] New to the PC Re:


 Hi,

 I use shareware GWD Text Editor (http://www.gwdsoft.com/)for REBOL
 editing. I made a long list of predefined REBOL words, so it has a
 crude form of syntax highlighting. But unfortunately it can't highlight
 or escape {multiline {
 "REBOL" ^}
 strings} like this one correctly. It uses Microsoft's MFC library so
 it's startup time is quite high. Other nice editor I have seen is
 Edit+ (http://www.editplus.com/).

 And, please, never use Windows Notepad. There are replacements that are
 more powerful and shorter than Notepad itself, like Metapad
 (http://welcome.to/metapad/)

 But, I couldn't get really used to Windows or Linux editors, I still
 miss the old Amiga CygnusEd and GoldEd :-(

 hope this helps,

 --
 Michal Kracik







[REBOL] Function launch bug

2000-10-17 Thread jschuhr

Assuming you have three reblets: one.r, two.r, and three.r as shown below:

one.r
+--
REBOL []
print "I'm one!"
launch "two.r"
wait 00:01

two.r
+--
REBOL []
print "I'm two!"
launch "three.r"
wait 00:01

three.r
+--
REBOL []
print "I'm three!"
wait 00:01


If you run rebol.exe and type "do %one.r", then one.r runs displaying it's 
message, two.r runs displaying it's message but three.r never runs.  Only 
the first call to the function works.. subsequent calls in the launch 
processes are ignored.

--John
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.




[REBOL] cgi configuration with apache

2000-10-17 Thread jwold

I know this has been brought up several dozen times on this list.  However I
lost my archive due to an "accident" *grin*

I was wondering how I setup rebol as a cgi wrapper. (httpd.conf entries and
etc..)



Jarrett




[REBOL] New to the PC Re:

2000-10-17 Thread adfarm

Hi David,

   I use SynEdit! I found it on zdnet.com and it is free!!

Michael

-Original Message-
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, October 17, 2000 2:07 PM
Subject: [REBOL] New to the PC


Hello All:

I've just got myself a windows machine.  My Amiga has had problems
(Simm sockets are messed up), so I was hoping someone would know of  a
good editor to use on Win95 (preferably free, as I hope to get my
Amiga back up soon).

Thanks to any and all that help!

Regards,
David C.

P.S. - Linux isn't an option, as my Bios is flooky on the pc.







[REBOL] Port probing Re:(4)

2000-10-17 Thread allen

Hi John,

You need to also add a port for view events. Using 'dispatch makes it easier
to react to different ports. See note below about the attached script.

 ? dispatch
USAGE:
DISPATCH port-block

DESCRIPTION:
 Wait for a block of ports. As events happen, dispatch port handler
blocks.
 DISPATCH is a function value.

ARGUMENTS:
 port-block -- Block of port handler pairs (port can be timeout too).
(Type: block)

;-
The attached View script communicates a message to each member in its client
list.
To use... Run 3 instances of the script and set the port numbers to 8001,
8002, 8003
Now anything you type in one will show in the other two.

Hope this script helps someone.

Cheers,

Allen K




REBOL [
Title: "View Peer Chat Demo"
Author: "Allen Kamp" 
Purpose: "Simple peer-to-peer chat in View"
status: "prototype"
]

;comments start of DirectPlay like gaming subsystem

system/options/quiet: true
system/console/busy: none


host-address: does [system/network/host-address]
host: does [system/network/host]

clients: reduce [
 host-address  "8001"
 host-address  "8002"
 host-address  "8003"
]

my-address: host-address

port-num: 8001
message-port: none
; for view events
event-port: open [scheme: 'event]

set-message-port: func [
"Changes Port Address of Connection"
port-id
][
if port? message-port [close message-port]
message-port: open/direct join tcp:// [":" port-id]
]

do-message: func [/local data newline? type address][
if none? data: copy first message-port [close message-port return 'break] 
newline?: does [either empty? converse/text [""][newline]]
set [type address data] parse/all data "#"
if data = "quit" [close message-port close event-port quit]
append tail converse/text join newline? [address " - " data]
show converse
]

do-event: func [/local event][
event: first event-port
if event/type = 'close [quit]
do event
]

tell-all: func [list [block!] data][
   foreach [ip port-id] list [
   if error? try [tell ip port-id data][print ["Error - No Connection" ip port-id]]
   ]
]

tell: func [ip port-id data /local client][
client: open rejoin [tcp:// ip ":" port-id]
insert client rejoin ['msg "#" ip ":" message-port/port-id "#" data]
close client
]

view/new layout [
across 
client-ip: txt join "IP " host-address navy 200 bold
server-ip: field form port-num button "Set Port" [set-message-port server-ip/text]
return  
converse: area 516 with [para: [wrap?: true]] 
v1: slider to-pair reduce [16 converse/size/y][scroll-para converse face]
 return below
msg: field 516 
button #"^M" "send" [
tell-all clients copy msg/text
system/view/caret: head clear msg/text
show msg
] 
]

set-message-port port-num

dispatch [
message-port :do-message
event-port   :do-event
]




[REBOL] verify existence of a word Re:(2)

2000-10-17 Thread tim

Thanks Al!
Better to be wrong in the list than
wrong in the release!
:)
Regards
-Tim

[EMAIL PROTECTED] wrote:

  Two questions:
  1) How may I query rebol to verify whether a word exists?
  2) How may I query rebol to verify whether a member of an object exists?

  value? 'print
 == true
  value? 'antidisestablishmentarianism
 == false
  o: make object! [m: ""]
  in o 'antidisestablishmentarianism
 == none

  I'll  betcha 1) answers 2). :)

 You'll be wrong! :-)

 Andrew Martin
 ICQ: 26227169
 http://members.nbci.com/AndrewMartin/
 --




[REBOL] Bang the REBOL Drum

2000-10-17 Thread PAUL . MAY

just a quick note to say  i`v just posted a `use REBOL` post
in reply to some readers requests about Scripted FTP over
on the comp.os.qnx NG, seeing as i dont really know REBOL
codeing to any great degree, (i`m just looking after my
Phx members interests) perhaps some of you trying out the RTP
might pop over there and follow up on my post to try and
convince the hard core developers and new RTP users alike
that are massing around that NG and the qdn MLs the virtues
of REBOL/* and how they might use it in their dayly lives ?.

i`ll be looking out for your posts, even if i dont reply,
band that REBOL /DRUM, they need to know about its power.

ill start off: DRUM
* Developers Realise Untaped Markets

--
 Paul May, Manchester, UK
 Team *Phoenix* Core




[REBOL] New to the PC Re:

2000-10-17 Thread Al . Bri

 I was hoping someone would know of a good editor to use on Win95
(preferably free, as I hope to get my Amiga back up soon).

A free decent text editor and very good replacement for Windows Notepad is
Metapad:
http://welcome.to/metapad/

And if you want a free good Word Processor, Spreadsheet, database, etc, (and
you afford a 80MB download, try Star Office at:
http://www.sun.com
and follow the link at the top. You'll need a reasonably fast machine as
it's written in Java.

Andrew Martin
Who desperately wants Rebol to supplant Java...
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
--





[REBOL] New to the PC Re:

2000-10-17 Thread targhan

Thanks to all,

I've at least temporarily picked "syned."  I really hope to have my Amiga
back up soon, so I can use GoldED Studio again.

Now, I can only hope the bug that keeps R/View from launching apps accross
the internet on the Amiga is fixed soon ;o)

Thanks again for all of the replies!!





[REBOL] Bang the REBOL Drum Re:

2000-10-17 Thread allen

Hi Paul,

For a quick intro and some handy shell scripts, you can point them to Jeff's
recent article at
http://www.unixreview.com/development/articles/0009ds.shtml


I see QNX are going to be at ACE2K http://www.ace2k.net . I'll be running a
stall there and banging the REBOL drum too. Melbourne REBOLs, why not pop in
and say hello? I'll be happy to answer any QNX'rs questions about REBOL at
the exhibition too.


Cheers,

Allen K
Rebol Forces..


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 18, 2000 1:05 PM
Subject: [REBOL] Bang the REBOL Drum


 just a quick note to say  i`v just posted a `use REBOL` post
 in reply to some readers requests about Scripted FTP over
 on the comp.os.qnx NG, seeing as i dont really know REBOL
 codeing to any great degree, (i`m just looking after my
 Phx members interests) perhaps some of you trying out the RTP
 might pop over there and follow up on my post to try and
 convince the hard core developers and new RTP users alike
 that are massing around that NG and the qdn MLs the virtues
 of REBOL/* and how they might use it in their dayly lives ?.

 i`ll be looking out for your posts, even if i dont reply,
 band that REBOL /DRUM, they need to know about its power.

 ill start off: DRUM
 * Developers Realise Untaped Markets

 --
  Paul May, Manchester, UK
  Team *Phoenix* Core






[REBOL] objects without overhead

2000-10-17 Thread rishi

I am working on a program which requires about 1000 or so instances of objects. It 
doesn't have to be OO but I like the design better that way. I am using a function as 
constructor like the following example (not real code..):

;I used dashes to keep formatting intact (hopefully this works)

make_myobject: func[var1 var2 var3][
--return make object! [ 
instancevar1: var1
instancevar2: var2
instancevar3: var3

instancefunc1: func[][...]
.
.
.
-]
]


The thing I don't like about this solution is that every instance of this object has 
duplicate copies of the functions (As far as I know...please correct me if I am 
wrong). This seems like a waste to me - especially if the object has 50 or so 
functions. Is there any OO way in Rebol to create multiple instances of this object 
without creating multiple copies of the functions associated with each object? I know 
how to do this in a non-object oriented fashion but would like to see an OO solution.