[REBOL] Re: Evaluation Re:(10)

2000-01-09 Thread giesse

Hello [EMAIL PROTECTED]!

On 08-Gen-00, you wrote:

 j Hmmm. Interesting, but I can see your point. How about 'bind?
 j Do you consider that as modifying the word itself (not its
 j value)?

In one of my previous posts, I showed that bind doesn't change
words, but creates new ones. I'm starting to think that words are
immutable...

BTW, do you think that immutable series would be better? Would
their behaviour be more intuitive? I'm asking because I'm not an
expert in this field. :-) 

Regards,
Gabriele.
-- 
o) .-^-. (--o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o) `-v-' (--o




[REBOL] Regular Expressions Re:(7)

2000-01-09 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

 Hi Petr, 9-Jan-2000 you wrote:

 [...]
  This will not work imho :-)
 
  You're right. As I said, it was completely untested ;-)
 
  I used "to" instead of "thru", and we need the /all refinement. But
 apparently
  that's still not enough, though I don't know why...
 

 As I said - it doesn't matter if you used 'to or 'thru, because once you are
 back
 from 'b's maddening :-), you are standing just behind the last occurance of
 "ing"
 in the parsed string ...

 Erm, we should be standing just in front of it, otherwise there's now point?

OK, you are right, you standing in front of "ing" being found by backtracking
fromt the end of the script. This is EXACTLY the phase, when right part of rule is
executed for the first time with 'true as a result. So, "ing" is matched now, what
next?

We are STILL deep in recursion, but as rule was succesfull, it DOESN'T return one
level higher, but tries to find another rule on the same level. But there is not
any. "to end" would solve it. The result is, even if "ing" got matched and
applying of rule was a success, it doesn't mean whole parse is succesfull. It's
like expecting parse "ringing bells" [thru "ing"] is going to return 'true, but it
isn't as "to end" is missing ...

 And I wanted to see if we had a separator just behind the "ing", which means
 I should use 'thru.

  To make things even more spooky, look at this:
 
  sep: charset " ,.!?"
  b1: [skip b1 | "ing"]
  b2: [skip b2 | "ing" sep to end]
  a: [b1 | b2]
 
  The idea here is that b1 will match any string ending in "ing", and b2 will
  match any string which contains "ing" followed by a separator. Now, watch
  this:
 
   parse/all "ringing bells" b2
  == true

 it's just the same as 'b1, it just contains the code to skip to the end of
 the
 string 

 Yes. As I said above:

 The idea here is that b1 will match any string ending in "ing",

no, it will match any string CONTAINING "ing". Look at what b1 does in itself.
Let's assume string not containing "ing"

- str: "some text without i.n.g."

- b1: [skip b1-mark: (print ["b1: " b1-mark index? b1-mark]) b1 | b2-mark:
(print ["b2: " b2-mark  index? b2-mark]) "ing"]
== [skip b1-mark: (print ["b1: " b1-mark index? b1-mark]) b1 | b2-mark: (print
["b2: " b2-mark index? b2-mark]) "ing"]

- parse/all str b1
b1:  ome text without i.n.g. 2
b1:  me text without i.n.g. 3
b1:  e text without i.n.g. 4
b1:   text without i.n.g. 5
b1:  text without i.n.g. 6
b1:  ext without i.n.g. 7
b1:  xt without i.n.g. 8
b1:  t without i.n.g. 9
b1:   without i.n.g. 10
b1:  without i.n.g. 11
b1:  ithout i.n.g. 12
b1:  thout i.n.g. 13
b1:  hout i.n.g. 14
b1:  out i.n.g. 15
b1:  ut i.n.g. 16
b1:  t i.n.g. 17
b1:   i.n.g. 18
b1:  i.n.g. 19
b1:  .n.g. 20
b1:  n.g. 21
b1:  .g. 22
b1:  g. 23
b1:  . 24
b1:   25
b2:   25
b2:  . 24
b2:  g. 23
b2:  .g. 22
b2:  n.g. 21
b2:  .n.g. 20
b2:  i.n.g. 19
b2:   i.n.g. 18
b2:  t i.n.g. 17
b2:  ut i.n.g. 16
b2:  out i.n.g. 15
b2:  hout i.n.g. 14
b2:  thout i.n.g. 13
b2:  ithout i.n.g. 12
b2:  without i.n.g. 11
b2:   without i.n.g. 10
b2:  t without i.n.g. 9
b2:  xt without i.n.g. 8
b2:  ext without i.n.g. 7
b2:  text without i.n.g. 6
b2:   text without i.n.g. 5
b2:  e text without i.n.g. 4
b2:  me text without i.n.g. 3
b2:  ome text without i.n.g. 2
b2:  some text without i.n.g. 1
== false
-

huh :-) and we are back from all recursion calls. Being it one way or other, I
would suggest forget your technique, as it's very inefficient ...

and now, let's change str to contain "ing, just to see, when we get out from the
rule:

- str: "some text withing i.n.g."
== "some text withing i.n.g."

- parse/all str b1
b1:  ome text withing i.n.g. 2
b1:  me text withing i.n.g. 3
b1:  e text withing i.n.g. 4
b1:   text withing i.n.g. 5
b1:  text withing i.n.g. 6
b1:  ext withing i.n.g. 7
b1:  xt withing i.n.g. 8
b1:  t withing i.n.g. 9
b1:   withing i.n.g. 10
b1:  withing i.n.g. 11
b1:  ithing i.n.g. 12
b1:  thing i.n.g. 13
b1:  hing i.n.g. 14
b1:  ing i.n.g. 15
b1:  ng i.n.g. 16
b1:  g i.n.g. 17
b1:   i.n.g. 18
b1:  i.n.g. 19
b1:  .n.g. 20
b1:  n.g. 21
b1:  .g. 22
b1:  g. 23
b1:  . 24
b1:   25   ; skip fails for the first time here :-)
b2:   25   ; second part of rule applied for the first time :-)
b2:  . 24
b2:  g. 23
b2:  .g. 22
b2:  n.g. 21
b2:  .n.g. 20
b2:  i.n.g. 19
b2:   i.n.g. 18
b2:  g i.n.g. 17
b2:  ng i.n.g. 16
b2:  ing i.n.g. 15
== false
-

oops - do you see? "ing" was applied, but we are NOT returning to upper levels of
recursion. The result is  - 'false, but why? As the rule doesn't contain "to end"


and b2 will

 match any string which contains "ing" followed by a separator.


 Notice the use of "ending in" and "contains".

 [...]
 6) so b1 is true for the first time and we are standing just behind the "ing"
 string, so at beginning of "bells", or " bells", once parse/all is used 

 You _do_ mean that we're in front of the "ing" string, right?

yes, once we are just in front of "ing", we can finally apply "ing" from the 

[REBOL] Regular Expressions Re:(7)

2000-01-09 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

 It is true that we get a ridiculously deep recursion. In effect, we first go
 to the end of the string (by recursion), then we step backwards and each time
 look if the string from the position we're at is "ing". So:

 1: If we have a string with n chars, ending in "ing":
 First make n recursive calls. On the third character on the way back, we find
 out that our string ends with "ing", and we therefore return "success" all
 the way up back through the recursion.


No. look at my previous post. Look at console outputs - we are not going back
anymore, once succesfull. That's the main point where we differ.

 Why haven't I got a chance of matching "ing"? When we're at the point where we
 have reached the end of the string, the part left to "|" will fail
 immediately, since 'skip fails. Then we try to match "ing", which will fail.
 Only when we go three steps back (i.e. we're at the position in the string
 where we can see the last 3 characters in the string), the match on "img"
 might succeed.

Sory for confusion, I meant exactly the same ...

 If so, the "succeed" result is propagated all the way through
 our recursive calls, since "skip a" has then succeeded for all the calls
 above.

No ... or at least, it doesn't seems so. Once "ing" is matched, it returns 'true
one level higher, no ALL levels higher. So, returning 'true one level higher means
parsers tries to continue at that level, skipping the rest of the rule | ],
and then? No more code here, not "to end" here, so we matched "ing", but still not
at the end of the string, so it returns false. Not returning to upper levels
though!

-pekr-


 Kind regards,
 --
 Ole Friis [EMAIL PROTECTED]

 "Ignorance is bliss"
 (Cypher, The Matrix)



[REBOL] Re: Regular Expressions Re:(4)

2000-01-09 Thread giesse

Hello [EMAIL PROTECTED]!

On 09-Gen-00, you wrote:

 o To make things even more spooky, look at this:

 o sep: charset " ,.!?"
 o b1: [skip b1 | "ing"]
 o b2: [skip b2 | "ing" sep to end]
 o a: [b1 | b2]

 o The idea here is that b1 will match any string ending in
 o "ing", and b2 will match any string which contains "ing"
 o followed by a separator. Now, watch this:

 o parse/all "ringing bells" b2
 o == true
 o parse/all "ringing bells" a 
 o == false


I have the answer for you: change b1 as:

b1: [skip b1 | "ing" end]

Do you see what I mean?

Regards,
Gabriele.
-- 
o) .-^-. (--o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o) `-v-' (--o




[REBOL] Re: REBOL puzzle/challenge Re:(2)

2000-01-09 Thread giesse

Hello [EMAIL PROTECTED]!

On 09-Gen-00, you wrote:

 w   Has anyone put to good use do/next, load/next ? 

Have a look at my recent post, Subject: Parse...

:-)

Regards,
Gabriele.
-- 
o) .-^-. (--o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o) `-v-' (--o




[REBOL] Re: REBOL puzzle/challenge

2000-01-09 Thread giesse

Hello [EMAIL PROTECTED]!

On 08-Gen-00, you wrote:

 w   1. Can you simulate a static local variable in REBOL? The

There are plenty of ways to do this...

 use [static] [
[static: none
[f: func [a] [ 
[print ["Last was:" static]
[static: a 
[]
[]
 f 1
Last was: none
== 1
 f 5
Last was: 1
== 5
 f "But..."
Last was: 5
== "But..."
 recycle
 f "... there's still the bug!"
** CRASH (Should not happen) - Corrupt datatype: 66

Just another one:

 f: func [a] [
[static: [none]
[print ["Last was:" static/1]
[change/only static a
[]
 f 1
Last was: none
== []
 f 4
Last was: 1
== []
 f "This should work always, I hope..."
Last was: 4
== []
 f ":-)"
Last was: This should work always, I hope...
== []

 w   2. Can you create a line of REBOL code, including two or
 w more functions of arity one or more (that take one or more
 w parameters), that results in the same result forwards or
 w backwards? To verify, put the code in a block, and try:

Well, this way's too simple. :-) I could write:

 f: func [:a :b] ["Result"]
 code: [f f f]
== [f f f]
 do code
== "Result"
 do head reverse code
== "Result"

It's better to exclude these simple cases from the puzzle, to make
it more interesting... :-)

 w   3. Can you make a function which takes one argument, unless
 w called with a refinement in which case the function takes no
 w arguments?

This one's challenging, at least at first sight. One solution
might be:

 f: func [  
[[catch]
[a [any-type!]  
[/b 
[] [
[either b [ 
["No parameter!"
[] [
[if not value? 'a [throw make error! [script no-arg f a]]
["One parameter"
[]
[]
 f
** Script Error: f is missing its a argument.
** Where: f
 f 2
== "One parameter"
 f 4
== "One parameter"
 f/b
== "No parameter!"

But:

 f/b 4
== "No parameter!"

Hmm... I'll have to think about this... :-)

 w   4. Can you create a parse rule that recognizes whether a
 w string of numbers is from the Fibonacci sequence?

Generalizing for any sequence,

 sequence: [13 46 38 59 79 47 22 4 68 2]
== [13 46 38 59 79 47 22 4 68 2]
 string: "  13  46 38   59  79 47 224 68   2"
== "  13  46 38   59  79 47 224 68   2"
 parse string [  
[(i: 1 number: form sequence/1)   
[some [   
[number (i: i + 1 number: form pick sequence i)
[]
[]
== true

You can apply the same kind of rule for any function...

Regards,
Gabriele.
-- 
o) .-^-. (--o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o) `-v-' (--o




[REBOL] What's next for REBOL... Re:

2000-01-09 Thread dimial

...a copy to the only (I think..) rebol user in Greece please!!


  My
 plan is to release a beta by mid-January to those of you who
 want to test drive it.  I will provide a number of interesting
 example scripts that I guarantee will be immediately useful to
 you.
 
 There is a bonus for those of you who like technical challenges.
 REBOL/View will include its GUI dialect source code. That gives
 you the power to enhance the GUI as well as create your own custom
 GUI dialect, say for interactive TV, kiosks, games, or whatever.







[REBOL] UDP Re:(6)

2000-01-09 Thread Russ

Whomever you ask, I hope they'll reply here on the list so we all can
benefit from the info!  This is something I've wanted to know more about (as
well as UDP with REBOL) for some time.  Thanks,  /Russ

-
At 02:22 PM 1/9/2000 +0200, you wrote:
snip
BTW, I have spent some time over the last holidays studying how
protocol handlers work, because I need to write one. I still need
some clarifications on the port flags, and the meaning of the
fields in port/state... this could save me some time. :-) Can I
ask to you, Jeff, or should I ask to Sterling?

Regards,
Gabriele.
-- 



[REBOL] UDP Re:(6)

2000-01-09 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

 Hello [EMAIL PROTECTED]!

 On 08-Gen-00, you wrote:

  w though. I don't think, or at least never heard that anyone had
  w ever really verified the udp stuff before (due to udp's lack
  w of popularity I suppose) so I thought I'd take a peek it at. I

 Actually, there was a guy some time ago asking on the list why the
 udp ports didn't work...

  w As for refinements, I've never tried to use /custom /mode
  w refinements. Do they actually work?
  w  Not sure about /custom... I'll add that to my ever growing
  w poke list.. but /mode works like this:
 [...]

 I think that the block passed to /custom is just assigned to
 port/state/custom, so that a custom port handler can use it. This
 way is possible to pass custom parameters to custom handlers.

 BTW, I have spent some time over the last holidays studying how
 protocol handlers work, because I need to write one. I still need
 some clarifications on the port flags, and the meaning of the
 fields in port/state... this could save me some time. :-) Can I
 ask to you, Jeff, or should I ask to Sterling?


yes, I would like to know, how does internally 'query work, as with
%multisession.r script, once friend from some domain tried to connect to
my machine, script disconnected us. The only one place it could happen
is "if query"  But we can't find out, why it happens so ...
-pekr-


 Regards,
 Gabriele.
 --
 o) .-^-. (--o
 | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
 | GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
 o) `-v-' (--o



[REBOL] Music (MP3) on REBOL Re:(3)

2000-01-09 Thread allenk

Hi Kevin et al,

I've got a REBOL Mp3 ID3v1 tag reader here if that of any use to you. Could
use it as part of
automating file naming as per the ID3 tag info.

I'm going to use it as part of playlist creator, ie make-playlist/year
%list-1983.mpu 1983

Let me know if interested. I tried to post it to REBOL.org, but it made a
loud thud :(

Cheers,

Allen K

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 09, 2000 7:19 AM
Subject: [REBOL] Music (MP3) on REBOL Re:(2)


  [EMAIL PROTECTED] wrote:
 
   Any plans for REBOL to support MP3?
 

 Petr wrote:
  ... but maybe there is another way ... REBOL/Command should support
REBOL
  embedding into custom apps. So let's ask mp3 players authors to add
rebol
  port into it and you can link your rebol to such app. Another solution
is
  - REBOL/Command is supposed to support external apps execution at least,
  so you will be able to start your favourite mp3 player ...

 Why wait?  A REBOL port is just a standard TCP/IP port, and there
 already  MP3 players that can be controlled via TCP.

 I'm in the (slow) process of building a standalone/dedicated MP3
 player into an old CD player chassis I had laying around.  See the
 attached code.  I welcome any comments or feedback.

 Cheers,
 Kev

 
 Kevin McKinnon, Network Engineer [EMAIL PROTECTED]
 Sunshine Communications http://www.sunshinecable.com
   **NOTE NEW E-MAIL ADDRESS**
 PGP Public Key: http://www.dockmaster.net/pgp.html   PGP 6.0 www.pgp.com








 #!/usr/local/rebol/rebol -s

 REBOL [
 Title:  "MP3 Controller"
 Date:   29-Dec-1999
 Author: "Kevin McKinnon"
 File:   %mp3.r
 Email: [EMAIL PROTECTED]
 Purpose: {
 Controller for a stand-alone MP3 player which is being
 built with a P233MMX motherboard mounted inside a gutted
 Pioneer PDM-401 6-pack CD Player chassis.  The LCD routines
 control a Matrix Orbital LK204-25 serial LCD display.
 (www.matrixorbital.com, Cdn distrib: www.hvwtech.com)
 Operating system: Linux 2.2.13 (Slackware 7.0)
 MP3 player: www.mpegtv.com
 This script is called via a shell script that pipes the output
 of the MP3 player into Rebols STDIN.
 All song filenames are formatted "Artist-Title.mp3" for easy parsing.

 'input?/'input don't seem to be working all that well for the piped
 input from xaudio.  Can read-io be used for STDIN?

 }
 ]

 com: open/binary/direct %/dev/ttyS1
 cmd: to-string #{FE}
 lcdclear: rejoin [cmd "X"]
 lcdhome: rejoin [cmd "H"]
 lcdcurson: rejoin [cmd "J"]
 lcdcursoff: rejoin [cmd "K"]
 lcdcursblinkon: rejoin [cmd "S"]
 lcdcursblinkoff: rejoin [cmd "T"]
 lcdwrapon: rejoin [cmd "C"]
 lcdwrapoff: rejoin [cmd "D"]
 lcdscrollon: rejoin [cmd "Q"]
 lcdscrolloff: rejoin [cmd "R"]
 lcdbacklighton: rejoin [cmd "B" ^@]
 lcdbacklightoff: rejoin [cmd "F"]
 lcdinit: rejoin [lcdwrapon lcdscrollon lcdbacklighton lcdcursoff
  lcdcursblinkoff lcdclear]
 runtime: 0:00:01

 append com lcdinit

 titleartistdisplay: make function! [filename] [
   tasplit: parse first parse last parse to-string filename "/" "." "-"
   artist: copy/part join first tasplit [""] 20
   title: copy/part join second tasplit [""] 20
   duration: rejoin [" " counter]
   display: rejoin [lcdhome title artist duration]
   append com display
 ]

 mp3cue: make function! [filename] [
   mp3ctlport: open tcp://127.0.0.1:9717
   print rejoin ["open " to-string filename crlf]
   insert mp3ctlport rejoin ["open " to-string filename crlf]
   close mp3ctlport
   while [input?] [
 a: input
 if (find a "duration") [
   runtime: to-time to-integer last parse a "[]"
 ]
 if ((copy/part a 22) = "MSG notify stream info") [break]
 print a
   ]
 ;  print "broke with ack"
 ]

 mp3play: make function! [] [
   mp3ctlport: open tcp://127.0.0.1:9717
   print rejoin ["play" crlf]
   insert mp3ctlport rejoin ["play" crlf]
   close mp3ctlport
 ]

 mp3stop: make function! [] [
   mp3ctlport: open tcp://127.0.0.1:9717
   print rejoin ["stop" crlf]
   insert mp3ctlport rejoin ["stop" crlf]
   close mp3ctlport
 ]

 mp3close: make function! [] [
   mp3ctlport: open tcp://127.0.0.1:9717
   print rejoin ["close" crlf]
   insert mp3ctlport rejoin ["close" crlf]
   close mp3ctlport
 ]

 comment {
 getkeypad: make function! [
   buffer: make string! 16
   result: make string! 16
   while [(read-io com buffer 16)  0] [
   append result buffer
   clear buffer
 ]
 ]
 }

 doplayer: make function! [musicfile] [
   mp3cue musicfile
   endtime: (to-time runtime) + now/time
   counter: endtime - now/time
   titleartistdisplay musicfile
   mp3play
   until [retport: wait [1]
 counter: endtime - now/time
 titleartistdisplay musicfile
 lesser-or-equal? (counter) 0:00:00
   ]
   

[REBOL] What's next for REBOL... Re:(5)

2000-01-09 Thread mailinglists

Hehe, now this is such a coincidence, the first time in years I can't check
my email for a week, and a thread like this comes along. Carl, your plan
sounds revolutionary, I would be glad to be a (small) part of it, thank you
for sharing it with us. Please count me in on the beta-list.

Third time, second time publicly:

Carl, YOU THE MAN!

You're half a world away from me, but your work has always been close...
Thank you, and keep up the outstanding work. You're really doing something
no one else has done before!

Regards,
Rachid


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 07, 2000 07:22
 To: [EMAIL PROTECTED]
 Subject: [REBOL] What's next for REBOL... Re:(4)


 Yes! As long as they have the same subject, I'll find them all,
 and we will send you REBOL/View.  Just as soon as we've got it.

 -Carl


 At 1/6/00 05:58 PM -0600, you wrote:
 Hello, is Rebol keeping count of all these "me too" messages, or
 will there
 be a "go here for the Rebol/view beta" message later?  If the former...
 ME TOO.
 
 Elliott
 
 On 04-Jan-00, [EMAIL PROTECTED] wrote:
 
  Hi:
 
  I also want to be part of the team
 
 
  My
  plan is to release a beta by mid-January to those
  of you who
  want to test drive it.
 





[REBOL] Regular Expressions Re:

2000-01-09 Thread KGD03011


Ole, thank you for telling me about DFA machines. It's much more than I
knew. I think it might be fun to implement with the model I'm using.

The hardest thing for me was implementing quantifiers. What I'm doing
with search-text.r is "compiling" an expression like

   [bound "t" 3 7 alpha "ing" bound]

to a form like:

   [bound "t" [4 6 3 7] make bitset! #{...} [3] "ing" bound]

in which the blocks are nodes which tell:

one or two elements to jump to
the minimum number of times the first jump must be made
the maximum number of times the first jump can be made

So we have to go through the cycle of elements 3/4/5

 ---
|   |
V   |
"t"(2) -  node(3) - bitset(4) - node(5) -
|
 - "ing"(6)

three times before we even think about jumping to the "ing" element.
What I'm doing is saving the number of times node(3) has been passed
in another block in a position tied to the "ing" element. When there
is a failure to match somewhere in the cycle, or when the cycle has
been done the maximum number of times, it's important to erase the
information on how many times node(3) has been passed, in case one loop
is nested inside another loop and there's a chance of coming back to
it.

Now with the NFA engine, saving a state means you only have to push
onto a stack the index of a jump you could have taken, plus the current
index of the text string. But with a DFA engine, you wouldn't need the
text string index (because once you deal with a character in the text
stream it's done once and for all) - is that right? On the other hand,
every time you come to a place where two jumps are possible you have
to start another thread so that both possible pattern indexes can be
compared against the next character in the text stream.

What seems especially complicated here is that you have to save the
information on which node has been passed how many times with each
thread. Complicated yes, but once a thread dies, it should be easier
to delete all the information associated with it.

Well, that's the idea anyway. If you would take a look at the code and
tell me any ideas you have, or if you could suggest a reference on
DFA machines, I'd really appreciate it.

Talk to you later,
Eric

Thanks,
Eric



[REBOL] Evaluation Re:(12)

2000-01-09 Thread lmecir

Hi, Gabriele,

I would like to add my $0,02. I think, that alias is another
interesting example of a modifying function having some effect on
words.

I don't think that immutable series can be better for all
applications. But, if you ask me, if immutable series are better
for storing a non-self-modifying code, then my answer sounds YES,
YES, YES!

Ladislav

 Hello [EMAIL PROTECTED]!

 On 08-Gen-00, you wrote:

  j Hmmm. Interesting, but I can see your point. How about
'bind?
  j Do you consider that as modifying the word itself (not its
  j value)?

 In one of my previous posts, I showed that bind doesn't change
 words, but creates new ones. I'm starting to think that words
are
 immutable...

 BTW, do you think that immutable series would be better? Would
 their behaviour be more intuitive? I'm asking because I'm not an
 expert in this field. :-)

 Regards,
 Gabriele.
 --
 o) .-^-.
(--o
 | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila
|
 | GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/
|
 o) `-v-'
(--o







[REBOL] What's next for REBOL... Re:

2000-01-09 Thread gmckenzi


Me too please.

And *please*...Rebol/Command is important too. I'm really waiting for
Rebol/Command, but Rebol/View would be cool.

Gavin.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: January 2, 2000 8:02 PM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] What's next for REBOL...


 What's next for REBOL...
 "More than just a tool."

 Since its first release, I estimate that more than 250,000
 people have tried REBOL.  More than 110,000 have downloaded it
 from REBOL.com, and it's also available on many other, larger
 web sites and on various CD-ROMs. In addition, I've received
 tens of thousands of emails from enthusiastic new users.  And,
 perhaps even more gratifying, most people I meet these days have
 at least heard of REBOL.

 All of this is a good start.  REBOL/Core is a great tool.  And,
 if that's all you want, then there you have it: REBOL.  However,
 I've always intended REBOL to be more than just a "tool".  REBOL
 is a revolution.  A revolution not just of "scripting", but of
 thought, style, content, and computing.

 So far, you've participated in the first stage of the
 revolution. That stage was centered around the core language and
 its environment. If you're like me, you've enjoyed writing
 dates, times, email, urls, money, tuples, and other datatypes in
 a manner that is familiar to us as humans.  Perhaps you've also
 found the built-in network protocols useful and experienced some
 of the power that comes from polymorphic function-based
 programming with refinements.

 Now is the time for the second stage: REBOL/View.  This stage is
 all about making REBOL useful and exciting for everyone else. In
 other words, more than just programmers and scripters should
 benefit from REBOL. For every scripter there are at least 100
 other people who would enjoy creating or viewing visual content
 with REBOL.

 REBOL/View unites a clean method of graphical layering,
 compositing, and processing with the expressive leverage of
 dialecting.  With it you create content and applications with as
 few lines as you accomplish other REBOL tasks such as networking.
 The GUI dialect allows your code to be descriptive and easy to
 read. In fact, it's much easier and more readable than HTML.

 When you combine this GUI with REBOL networking, you get a
 result that I enjoy calling the "World Wide Reb". Imagine a
 network where fully interactive graphical applications download
 into your system in just seconds.  These REBOL "smart-client"
 applications run on your local system, but access the network
 whenever necessary to fetch other parts of the application or
 communicate back to various servers or other clients. So, when
 you click on a button, something happens... not just in a few
 minutes or seconds, but immediately.

 That seems more like the kind of technology that's worthy of a
 revolution.  Don't get me wrong... The web is great for static,
 linear, document types of content.  That's a necessity that will
 be around for a long time.  But, I dream about the year 2005 and
 believe that our network experience will be much different by
 then.  I'm convinced that once you have had the chance to try
 REBOL/View, you'll agree with me.

 "When" you ask?  I've got the first draft design complete, and
 Jim has written the C-based graphical layering system.  Over the
 last week I've added the parse block capability necessary to
 make dialects easier to write, and the first GUI dialect is now
 up and drawing screens.  (Nice looking screens they are too.) My
 plan is to release a beta by mid-January to those of you who
 want to test drive it.  I will provide a number of interesting
 example scripts that I guarantee will be immediately useful to
 you.

 There is a bonus for those of you who like technical challenges.
 REBOL/View will include its GUI dialect source code. That gives
 you the power to enhance the GUI as well as create your own custom
 GUI dialect, say for interactive TV, kiosks, games, or whatever.

 Yes, the year 2000 has finally arrived.  It seems like a fitting
 time for a revolution, don't you think?

 Have a happy and REBOLlious 2000,

 Carl Sassenrath
 REBOL Creator  Founder
 Chairman  CEO

 PS: I'd like to also thank all of you who have helped support
 the REBOL cause and who have taken the time to share your
 knowledge and insights of REBOL with others on this list.
 Thank you so much.

 [Feel free to repost this email as you wish.]





[REBOL] Regular Expressions Re:(8)

2000-01-09 Thread ole_f

Hi Petr, 9-Jan-2000 you wrote:

[...]
any. "to end" would solve it. The result is, even if "ing" got matched and
applying of rule was a success, it doesn't mean whole parse is succesfull.
It's
like expecting parse "ringing bells" [thru "ing"] is going to return 'true,
but it
isn't as "to end" is missing ...

I understand this now. Sorry, I just didn't think this far.

[...]
huh :-) and we are back from all recursion calls. Being it one way or other,
I
would suggest forget your technique, as it's very inefficient ...

As I said in another mail, this wasn't what I had in my mind when I wrote the
mails - I just wanted a way to write the regular expressions in the Parse
dialect, not thinking of how Parse is actually implemented.

[...]
b2:  g i.n.g. 17
b2:  ng i.n.g. 16
b2:  ing i.n.g. 15
== false
-

oops - do you see? "ing" was applied, but we are NOT returning to upper
levels of
recursion. The result is  - 'false, but why? As the rule doesn't contain "to
end"

...and therefore the whole Parse operation fails, since we don't reach the end
of the input string. Yup, I get it now!

[...]
hope-this-helps

Sure! Thanks for being so stubborn on me, otherwise I wouldn't have understood
it ;-)

Kind regards,
-- 
Ole Friis [EMAIL PROTECTED]

"Ignorance is bliss"
(Cypher, The Matrix)



[REBOL] Regular Expressions Re:(2)

2000-01-09 Thread ole_f

Hi Eric, 10-Jan-2000 you wrote:

The hardest thing for me was implementing quantifiers. What I'm doing
with search-text.r is "compiling" an expression like

   [bound "t" 3 7 alpha "ing" bound]

to a form like:

   [bound "t" [4 6 3 7] make bitset! #{...} [3] "ing" bound]

in which the blocks are nodes which tell:

one or two elements to jump to
the minimum number of times the first jump must be made
the maximum number of times the first jump can be made

So we have to go through the cycle of elements 3/4/5

 ---
|   |
V   |
"t"(2) -  node(3) - bitset(4) - node(5) -
|
 - "ing"(6)

three times before we even think about jumping to the "ing" element.
What I'm doing is saving the number of times node(3) has been passed
in another block in a position tied to the "ing" element. When there
is a failure to match somewhere in the cycle, or when the cycle has
been done the maximum number of times, it's important to erase the
information on how many times node(3) has been passed, in case one loop
is nested inside another loop and there's a chance of coming back to
it.

Now with the NFA engine, saving a state means you only have to push
onto a stack the index of a jump you could have taken, plus the current
index of the text string. But with a DFA engine, you wouldn't need the
text string index (because once you deal with a character in the text
stream it's done once and for all) - is that right? On the other hand,

That's right.

every time you come to a place where two jumps are possible you have
to start another thread so that both possible pattern indexes can be
compared against the next character in the text stream.

You mean, with DFA's? In that case, no. Though, it's something like that you
need to do when you construct the DFA from the NFA.

What seems especially complicated here is that you have to save the
information on which node has been passed how many times with each
thread. Complicated yes, but once a thread dies, it should be easier
to delete all the information associated with it.

Once you have a DFA, you don't need to store such information. What you have
is one big system with states (nodes) and transitions (arrows between the
states, each associated with a character). You only need to remember which
state you are in.

Let's take a simple example: A DFA recognizing all binary numbers that are a
multiplum of 3 (11 binary ;-) ). State 1 is an accepting state:

  0
 |--|
 V  |
 --State 1 (accepting)
 | ^
1| |1
 V |
State 2
 | ^
0| |0
 V |
State 3
 | ^
 |-|
  1

I hope it's clear what it says:
From state 1: "0" moves to state 1, "1" moves to state 2.
From state 2: "0" moves to state 3, "1" moves to state 1.
From state 3: "0" moves to state 2, "1" moves to state 3.

We start in state 1 (that's why there's the arrow coming from the left), and
when we have a string, for example "10101" (which is 21 in decimal), you just
eat the characters from left to right, following the transitions. Since it is
a DFA (the D stands for deterministic, you know ;-) ), we will never have
more than one possible move (when we have no move for a given input
character, we reject the whole input string immediately). When we are done
with the whole string, we see whether or not we are in an accepting state. If
so, our DFA has recognized the input string. If not, our DFA has rejected the
input string.

Simple as that. As you can see, once we have built a DFA for a corresponding
regular expression, matching strings is _very_ fast and requires no
recursion, no stack, or whatever.

In fact, the only differences between a DFA are these:

1: An NFA may have more than one possible transition for certain input
characters in each state.
2: An NFA may have "the empty string" associated with a transition.

But the beauty is that given any NFA, you can construct a corresponding DFA.

Well, that's the idea anyway. If you would take a look at the code and
tell me any ideas you have, or if you could suggest a reference on
DFA machines, I'd really appreciate it.

I'll try to find some electronic material on DFA's tomorrow (when I have free
bandwith from University ;-) ).

Kind regards,
--
Ole Friis [EMAIL PROTECTED]

"Ignorance is bliss"
(Cypher, The Matrix)



[REBOL] Regular Expressions Re:(7)

2000-01-09 Thread ole_f

Hi Petr, 9-Jan-2000 you wrote:

[...]
 I have the answer for you: change b1 as:

 b1: [skip b1 | "ing" end]

b1: [skip b1 | "ing" to end] seems to do the job better :-)

No, since this will match any string containing "ing", and that wasn't the
intention of b1.

Kind regards,
-- 
Ole Friis [EMAIL PROTECTED]

"Ignorance is bliss"
(Cypher, The Matrix)



[REBOL] UDP Re:(7)

2000-01-09 Thread whip


  Whomever you ask, I  hope they'll reply here  on the list so we all
 can benefit from the info!   This is something  I've wanted to  know
 more about (as well as UDP with REBOL) for some time.  Thanks, /Russ

 - At 02:22 PM  1/9/2000 +0200, you   wrote: snip BTW, I  have
 spent some time  over  the  last  holidays studying  how   protocol
 handlers  work,  because I need  to  write one.  I  still need some
 clarifications on the port flags, and the  meaning of the fields in
 port/state... this could  save me some time. :-)  Can I ask to you,
 Jeff, or should I ask to Sterling?  Regards,  Gabriele. 

  Well, lessee.. generally, the state object relates to presenting the
data a port contains or fetches as a serialized set of values.
state/tail is the end of the data, what should be reported when you do
LENGTH? on a port.  Similarly, state/index is like a series
index. This value gets bumped when you call NEXT on the port.  When
the state/index = state/tail then the port is at the tail, and TAIL?
port will return true.  The state/flags there correspond to the
capabilities of the port.  At some point the doc team will cover ports
and clarify the other fields.  The time I've written handlers I never
really needed to touch most of the values in the state object.
(Sometimes you can't set these field when with some protocols you
can't know what the tail of the data is...)  To look at a protocol
that messes with the tail and index members of the state object check
out pop.  Typically, the open sequence will set the state variables.

  Now the port flags change the functional properties of the ports.
With network ports it generally comes down to either pass-thru ports
or direct-ports (all the built in protocol port handlers are one or
the other).  To see the differences in behavior try playing with the
script listed below. I know that's hand waiving, but I didn't
implement the port mechanism so I don't want to say anything incorrect
about them.  Give this a play, though.  Hope I've been helpful. (-: 

-jeff

  

REBOL [
Title: "Port Tester"
Purpose: {
Illustrates the different port mechanisms of
"direct ports", vs. "pass-thru" ports.
Discover the differences by playing with
two dummy ports.
}
]

tst-port: make root-protocol [
init: func  [port spec][print "Init" 1]
open: func  [port][
print "open" 
port/state/flags: port/state/flags or port-flags 2
]
close: func  [port][print "close"3]
write: func  [port][print "write"4]
read:  func  [port][print "read" 5]
copy:  func  [port][print "copy" 6]
insert: func [port][print "insert"   7]
pick: func   [port][print "pick" 8]
]

foreach [flags name] reduce [
system/standard/port-flags/direct'dport 
system/standard/port-flags/pass-thru 'pport
][
make tst-port compose [
port-flags: (flags) 
scheme: (to-lit-word name) 
;-arbitrary port number assigned below
net-utils/net-install (name) self (2000 + random 1000) 

]
]

print #DP dp: open dport://
print #PP pp: open pport://


;- Now notice the different results of
;  using COPY, INSERT, PICK, and CLOSE on 
;  the above ports.
;
;- also, try: read dport:// 
;   vs:   read pport://
;
;- and:   write dport:// # 
;   vs:   write pport:// #
;
; Pass-thru ports return results from different
; phases.  Pass-thru goes directly to named function
; with out buffering... 





[REBOL] archive

2000-01-09 Thread fuchs

Is anyone yet hosting this group as a news list? News.sunshinecable.com
was doing it for awhile but seems to have stopped (as of last Sept.).
Also is there a browsable archive anywhere?

Thanks,
Ira



[REBOL] count me in

2000-01-09 Thread aden






[REBOL] What's next for REBOL... Re:(6)

2000-01-09 Thread chesser

Me too! WIN98 and LINUX (SuSe 6.3)




[REBOL] archive Re:

2000-01-09 Thread xmldiva

Ira,

The REBOL mailing list archive resides at www.rebol.org. There are also
additional REBOL scripts available.

It would be very helpful if rebol.com would place a link on their site
indicating that this mailing list archive is available. This is a frequent
question most newcomers have.

BTW, does anyone know what the purpose of rebol.org is? I see no mission
statement there. Nor, do I understand why the material on rebol.org has to
be separate from rebol.com, that is, why not just have one website?

Hope this helps,

Cheryl


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 09, 2000 8:23 PM
Subject: [REBOL] archive


 Is anyone yet hosting this group as a news list? News.sunshinecable.com
 was doing it for awhile but seems to have stopped (as of last Sept.).
 Also is there a browsable archive anywhere?

 Thanks,
 Ira





[REBOL] archive Re:(2)

2000-01-09 Thread schlae

Hi Cheryl,

 The REBOL mailing list archive resides at www.rebol.org. There are also
 additional REBOL scripts available.

What's up with rebol.org? Whenever I go there, I get a directory listing
generated by their web server. There are no files there too.

Later,

Eric



[REBOL] timewarp bug? or Y2k bug? at rebol.org -Rebol survives the y12k r ollover? Re:

2000-01-09 Thread timewarp


  Hrrm, the date is alright in the script on my system, wonder what's
causing it to change when it's uploaded.  That's pretty currious.

  Cheerfulness,

-ATE

[EMAIL PROTECTED] wrote:
 
 Mr. "Timewarp" submitted some items to rebol.org and the page looks like
 this.
 Notice the rebol date stamp is good...but the other date say 27-Dec-11999.
 But perhaps the script that updates rebol.org is computing base on a string!
 type rather than date! type??
 
 
 UTILITY
 
  Find Functions That Use Specific Datatypes
Modified 27-Dec-1999/16:58:25-7:00
 
   Download: what-values.r View: what-values.html
   Date: 27-Dec-11999
   File: what-values.r
   Author: Erin A. Thomas
   Needs: found-deep.r
   Purpose: Find functions that take arguments of specific datatypes
   Comment: Blocks passed to what-values must contain only datatype values,
 it will complain and return NONE otherwise -- the
 found-deep? function in found-deep.r is used by this script
   Email: [EMAIL PROTECTED]
   Category: utility
 
  Find in nested blocks
Modified 27-Dec-1999/13:52:47-7:00
 
   Download: found-deep.r View: found-deep.html
   Date: 27-Dec-11999
   File: found-deep.r
   Author: Erin A. Thomas
   Purpose: Find deep inside nested blocks for specified values and return
 true if the value is found, otherwise return false
   Email: [EMAIL PROTECTED]
   Category: utility