r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Volker
16-Mar-2005
[775x2]
i would not use /awake in your case. more like
  forever[ wait port  your-code-here ]
also you have both server and client in the same process? this 'partner? 
i write such things using two consoles, one for client, one for server.
Gabriele
16-Mar-2005
[777]
DideC: try to start REBOL with -cw
DideC
16-Mar-2005
[778x3]
I have tried -c -w -cw, but I'm unable to pick anything from the 
standard input.

But I don't know how to handle that in the script :-\ (ports are 
not my tea cup).
My script :
   Rebol []
   probe copy system/ports/input
(Script is in %inp.r)
I have tried this command line (I'm on Win2k, Core 2.5.6) :

C:\> echo this is a test | rebol.exe inp.r
C:\> rebol.exe inp.r < test.txt
C:\> type test.txt | rebol.exe inp.r
Volker
16-Mar-2005
[781]
i understand from the webpage that redmon launches the program and 
send it input, just as a webserver does with cgi. then try it from 
the real program, not from the console. i don't know about xp, but 
in win9x console-pipes are pretty broken.
Gabriele
16-Mar-2005
[782x5]
REBOL []

write %test.txt copy system/ports/input
echo this is a test | rebol.exe -cw test.r
(hit ctrl-c to terminate it)
you get "this is a test" in test.txt
if you PROBE it, to see it on the command window you need a | more 
or something like that.
DideC
16-Mar-2005
[787]
Thanks,  it works :-))
sqlab
17-Mar-2005
[788]
Micha:
regarding your Async Server

You can modify your awake function like this

p/awake: func [ port /local  data  ] [
 	data: copy port
	either data [
		append tmp data
	] [
		close p 
		remove find system/ports/wait-list p
	]
]
BrianH
17-Mar-2005
[789]
I used to know this, but for which datatypes is a hash! indexed? 
Just strings, or words too?
Ladislav
18-Mar-2005
[790x2]
words, strings, integers, AFAIK
...numbers (and probably tuples too)
Sunanda
18-Mar-2005
[792]
The FAQ would suggest it works on any datatype:

Hashes are good for data that you are going to perform many searches 
on
http://www.rebol.com/faq.html#039
Gregg
18-Mar-2005
[793]
IIRC, they wok on anything. I know there was an ML discussion on 
any-block types some time ago, but I don't know how in depth it was 
WRT hashes.
BrianH
18-Mar-2005
[794x2]
It used to be just strings that were hashed. Other data types were 
just sitting there, and had to be found with a linear search like 
with other blocks.
I vaguely recall that they later started hashing some other datatypes, 
but can't recall which ones.
Joe
20-Mar-2005
[796]
Is there a  Perl compatible regular expression parser written in 
REBOL
Maxim
20-Mar-2005
[797x2]
note to volker:   what did I say  !!!!  ;-)


I was just telling volker privately, a few hours ago, how having 
regexp within REBOL would help those who migrate to it  ;-)
Joe, not that I know of.   Try to learn the 'Parse word.  There are 
a lot of parse experts hanging on this site... (not that I am one 
of them..)
Anton
20-Mar-2005
[799]
Yep, parse is great.
Graham
21-Mar-2005
[800]
is there a way to set the datestamp when writing a file?
Sunanda
21-Mar-2005
[801]
Try set-modes: 
http://www.rebol.com/docs/words/wset-modes.html
http://www.rebol.com/docs/words/wget-modes.html
Graham
21-Mar-2005
[802]
>> port: open/binary %xml-object.r
>> set-modes port [creation-date: 1-Dec-2004 ]
** Access Error: Cannot open /D/rebol/rebXR/xml-object.r
** Near: set-modes port [creation-date: 1-Dec-2004]
Sunanda
21-Mar-2005
[803]
What about 
   set-modes %xml-object.r  [creation-date: 1-Dec-2004 ]
But may not work on windows -- not all modes are supported.
Graham
21-Mar-2005
[804x4]
no, doesn't work either.
hey, that works !
I still had the port open so the first attempt failed
kewl.
Allen
21-Mar-2005
[808]
Larry's list of RegEx shortcomings http://www.perl.com/pub/a/2002/06/04/apo5.html?page=2
Graham
21-Mar-2005
[809]
24 pages of problems ??
Tomc
21-Mar-2005
[810]
it's a start ...
Graham
21-Mar-2005
[811]
I'll sleep better tonight now :)
DideC
21-Mar-2005
[812]
Does one say what is the syntax to specify parity on a serial port 
?

I saw "parity: none" on docs, but what does it mean, even or odd 
? And so what is the other syntax (odd or even) "parity: ????"
Dockimbel
21-Mar-2005
[813]
'none means "no parity". parity: 'odd or ' even should work fine.
Pekr
21-Mar-2005
[814]
port/update should be applied after the change IIRC ...
DideC
21-Mar-2005
[815]
So I can use 'odd or 'even in the URL  ?
Ie :
	open  serial://port1/9600/8/even/1
Pekr
21-Mar-2005
[816]
not sure ...
DideC
21-Mar-2005
[817]
will try ;-)
Pekr
21-Mar-2005
[818]
but maybe so, as you can use /none/1
DideC
21-Mar-2005
[819]
Seems to work ! Thanks
Pekr
21-Mar-2005
[820x2]
I also set rts-cts: off
I am not sure if rebol serial ports do work without that. I wanted 
simply my rebol tool to find our device on whatever port (autoscan) 
and it imo hangeg the app, even if I used open/direct/no-wait
Gregg
21-Mar-2005
[822]
WRT RegEx's -- I did a simple wildcard matcher (emulates VB's Like 
operator), and looked at hooking up PCRE, but it had a funky interface 
to it and I didn't get it working in the limited time I spent on 
it.
Graham
22-Mar-2005
[823]
Is it possible to set the modification date on a directory?  I keep 
getting errors whereas it works with files in win32.

>> set-modes %xml-parse.r [ modification-date: 1-Jan-2005 ]
>> set-modes %www/ [ modification-date: 1-Jan-2005 ]
** Access Error: Cannot open /D/rebol/rebXR/www/
** Near: set-modes %www/ [modification-date: 1-Jan-2005]
>> set-modes %www [ modification-date: 1-Jan-2005 ]
** Access Error: Cannot open /D/rebol/rebXR/www
** Near: set-modes %www [modification-date: 1-Jan-2005]
>>
Anton
22-Mar-2005
[824]
I think I remember getting the same error with directories.