[REBOL] Jens File Editor (JFE)

1999-11-28 Thread assembly

ANyone havethe settings for JFE to do syntax highlighting with REBOL? So I
dont have to do this all by hand?




[REBOL] Valid e-mail addresses

1999-11-28 Thread luis_marzulli

Hi

A question:

Using REBOL
How can I test if the username  has a mailbox at
the  e-mail server?

In other words: how can I test if @ is a valid
e-mail address?
(Of course I don't know the password)

Thank you

__
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com



[REBOL] Re: changing server w/set-net (YES!) Re:

1999-11-28 Thread giesse

Hello [EMAIL PROTECTED]!

On 24-Nov-99, you wrote:

 i So the difference results from how 'form handles words with or
 i w/o parens. Apparently, when form finds the literal word
 i 'service it simply embeds the word in quotation marks. In
 i contrast form apparently dereferences a word if that word is
 i surrounded by parentheses.

That behaviour is not due to form:

 word: "meaning"
== "meaning"
 var1: 'word
== word
 var2: make paren! [word]
== (word)
 var1
== word
 var2
== "meaning"
 form var1
== "word"
 form var2
== "meaning"
 form :var2
== "word"

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




[REBOL] Re: Interface and Implementation

1999-11-28 Thread giesse

Hello [EMAIL PROTECTED]!

On 26-Nov-99, you wrote:

 A I don't know why it works, but it does. Any ideas?

Why shouldn't it?

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




[REBOL] Re: Interface and Implementation Re:(2)

1999-11-28 Thread giesse

Hello [EMAIL PROTECTED]!

On 26-Nov-99, you wrote:

 A That Interface/Test returns the value of 't! In C++, this
 A wouldn't work, as the function 'Test_Implementation wouldn't
 A be able to find 't in 'Interface. It's disturbing to me as a
 A C++ programmer, but viewing it as a novice might, it seems
 A perfectly correct that the copied function "knows" where t is.

Andrew, I thought you had learned that there's so much difference
between C++ and REBOL... ;-) REBOL's objects are just contexts;
being your 't correctly bound to the right context, it evaluates
to the correct value.

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




[REBOL] Re: Imperative vs. Functional Re:

1999-11-28 Thread giesse

Just to add my 2 cents, I'd simply say that REBOL is DESCRIPTIVE.

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




[REBOL] Re: Tail recursion in REBOL 2.0

1999-11-28 Thread giesse

Hello [EMAIL PROTECTED]!

On 28-Nov-99, you wrote:

[...]
 o fac1 and fac2 are semantically identical. But how would you
 o dynamically see that you should eliminate tail recursion in
 o fac2? Sure, you could do it by looking forward some bytes
 o (seeing that there isn't anything more to do in the body of
 o the function), but if you should do this properly, program
 o execution will probably be slowed down.

REBOL 1.0 was tail recursive, and it was SLOW. This is because, as
Joe Marshall expalined to me, handling tail recursion is not an
easy thing to do. I'd like to see tail recursion back in REBOL,
but I'm not sure if I'd want the complexity of the interpreter to
increase. I'd prefer a better solution, such as testing for tail
recursion only on function that require it:

f: tail-recursive-func [...] [...]

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




[REBOL] cgi Re:(3)

1999-11-28 Thread ingo

I am no expert either, but I seem to have it going (at last).

I added the following to access.conf

Directory /home/ingo/public_html
AllowOverride All
Options ExecCGI FollowSymLinks
order allow,deny
allow from all
/Directory

This allows me to use CGI (ExecCGI) within the dir
/home/ingo/public_html and all its sub-dirs.

CGI scripts need to have the ending .cgi (this may be 
changed somewhere else), be runnable, and have a 
#!rebol -cs
in the first line (if the rebol executable is in the same
directory)

I don't remember if I changed other settings in the apache
conffiles, sorry


   1. SCRIPT LANGUAGE="REBOL" RUNAT="SEREVR"

This is not possible now, but wait for the rebol apache 
module, due to be in betatest soon. Of course then your
provider needs to install it ... (unless you're your own
provider)



hope this helps

Ingo


Those were the words of [EMAIL PROTECTED]:
 
 I am not an expert on this, and I don't have rebol working under
 Apache (yet) but the following thoughts occur to me:
 
   1. SCRIPT LANGUAGE="REBOL" RUNAT="SEREVR"
  
could "SEREVR" be misspelled?
 
   2. I use SuSE 6.1 which does a lot of the install/config of
 Apache for you. I have experimented with Apache
 only in loopback mode. The main config file is
 
  /etc/httpd/httpd.conf
 
 and it has a lot of comments in it which provide clues
 on which settings to fiddle with. I have included some
 *severely* snipped text from this file to give an idea -
 it is a starting point - I cannot claim to have retained
  all the settings you may need to fiddle with. Apache
   has a lot of documentation - books, web site, and
   stuff with the distribution. 
   Basically, it seems that any program that Apache
   calls through the cgi interface must either be
   loaded as an Apache module, or configured
   via httpd.conf  or both.
 
 3. I hope this is a little help, as I would like to see the
   detailed instructions myself.
 
 
 
 
 On Sat, 27 Nov 1999, you wrote:
  Well ... I have been waiting for a reply to the message below. Has there
  been a reply and I missed it? I have been trying to use rebol for CGI
  scripts which is the main reason why I started to use it. People have send
  CGI examples to me, which work for them but they don't work for me. I have
  by now tried to run rebol cgi scripts on WIN95 and PWS4, WIN98 and PWS4,
  Windows NTWS and PWS4, Windows NT Server and even tried it on a SuSe Linux
  and Apache. But nothing has worked for me so far.
  A previous message to the list said that rebol cgi did not need any setting
  up on the server, it only needs to have the rebol.exe in a directory where
  the scripts are. - Doesn't work for me. I have also seen an example of rebol
  to be used as follows ...
  
  SCRIPT LANGUAGE="REBOL" RUNAT="SEREVR"
  
  etc ... I would be VERY VERY VERY interested in knowing how to set this up
  or in knowing where I could host my web site that supports this.
  Any help would be great as I just don't know what else to do.
  
 
 
 
 =  snippings from /etc/httpd/httpd.conf which may be
 =   relevant to getting rebol to work under SuSe 6.1/Apache
 
 
 #
 # Each directory to which Apache has access, can be configured with respect
 # to which services and features are allowed and/or disabled in that
 # directory (and its subdirectories). 
 #
 # First, we configure the "default" to be a very restrictive set of 
 # permissions.  
 #
 Directory /
 Options FollowSymLinks
 AllowOverride None
 /Directory
 
 #
 # Note that from this point forward you must specifically allow
 # particular features to be enabled - so if something's not working as
 # you might expect, make sure that you have specifically enabled it
 # below.
 #
 
 
 #
 # ScriptAlias: This controls which directories contain server scripts.
 # ScriptAliases are essentially the same as Aliases, except that
 # documents in the realname directory are treated as applications and
 # run by the server when requested rather than as documents sent to the client.
 # The same rules about trailing "/" apply to ScriptAlias directives as to
 # Alias.
 #
 
 ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/"
 
 #
 # "/usr/local/httpd/cgi-bin" should be changed to whatever your ScriptAliased
 # CGI directory exists, if you have that configured.
 #
 
 Directory "/usr/local/httpd/cgi-bin"
 
 AllowOverride None
 Options None
 Order allow,deny
 Allow from all
 /Directory
 
 # cgi-bin for SuSE help system
 # using SetHandler
 
 
 
 Directory "/usr/lib/sdb/cgi-bin"
 AllowOverride None
 Options +ExecCGI -Includes
 SetHandler cgi-script
 /Directory
 
 # enable perl for cgi-bin
 #
 
 Location /cgi-bin
 
 AddHandler  perl-script .pl
 PerlHandler Apache::Registry
 PerlSendHeader On
 Options +ExecCGI
 /Location
 
 
 
 #
 # To use CGI scripts:
 #
 AddHandler cgi-script .cgi
 
 
 
 
 
 
 
 
 
Hi Rebols,





[REBOL] Encouraging functional programming Re:(8)

1999-11-28 Thread 70740 . 503

Ladislav,

I am impressed by your recursive fib. In fact it inspired me to write a
zero finding routine in a similar manner. If I am not imposing too much,
can you tell me if it is functional programming?

Jerry

 x: binsrch "x - exp - x" 'x 0 1
== 0.567143290409784
 exp - x
== 0.567143290409784


xeq: func [f v x] [do join v [": " x]  do f]

binsrch: func [f v b e]
[
   if ((xeq f v b) * (xeq f v e))  0
   [print "binsrch: f must have different signs at endpoints"
   return none]
   either (xeq f v b)  0
   [binsrch0 f v b e 50]
   [binsrch0 f v e b 50]
]

binsrch0: function [f v b e n] [x]
[
   x: b + e / 2
   if n = 0 [return x]
   either (xeq f v x)  0
   [binsrch0 f v x e n - 1]
   [binsrch0 f v b x n - 1]
]



[REBOL] Q on Array of Objects Re:(4)

1999-11-28 Thread ingo

Hi Andrew,

Those were the words of [EMAIL PROTECTED]:
...
 Words in objects which refer to functions are copied. Therefore the
 object will be bigger than expected.
...

seems logical, given that functions are the same as data in Rebol,
but it would be nice to have them only once for a set of equal
objects, ...


regards,

Ingo

--  _ ._
ingo@)|_ /|  _| _  We ARE all ONE   www._|_o _   _ ._ _  
www./_|_) |o(_|(/_  We ARE all FREE ingo@| |(_|o(_)| (_| 
http://www.2b1.de/Rebol/ ._|  ._|



[REBOL] Tail recursion in REBOL 2.0 Re:(2)

1999-11-28 Thread ingo

When I asked Rebol Tech about tail-recursion some time ago, 
that was what they told me. And that they wanted it back, too,
but only for functions that need it. So maybe we'll at some time 
see a function argument [recursive], or the like,


regards,

Ingo


Those were the words of [EMAIL PROTECTED]:
... 
 REBOL 1.0 was tail recursive, and it was SLOW. This is because, as
 Joe Marshall expalined to me, handling tail recursion is not an
 easy thing to do. I'd like to see tail recursion back in REBOL,
 but I'm not sure if I'd want the complexity of the interpreter to
 increase. I'd prefer a better solution, such as testing for tail
 recursion only on function that require it:
 
 f: tail-recursive-func [...] [...]
 
 Regards,
 Gabriele.
 -- 
 o) .-^-. (--o
 | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
 | GIESSE on IRC \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
 o) `-v-' (--o
 
 
Hi Rebols,




regards,

Ingo

--  _ ._
ingo@)|_ /|  _| _  We ARE all ONE   www._|_o _   _ ._ _  
www./_|_) |o(_|(/_  We ARE all FREE ingo@| |(_|o(_)| (_| 
http://www.2b1.de/Rebol/ ._|  ._|



[REBOL] Tail recursion in REBOL 2.0 Re:(2)

1999-11-28 Thread icimjs

Hi Gabriele,

REBOL 1.0 was tail recursive, and it was SLOW. This is because, as
Joe Marshall expalined to me, handling tail recursion is not an
easy thing to do. I'd like to see tail recursion back in REBOL,
but I'm not sure if I'd want the complexity of the interpreter to
increase. I'd prefer a better solution, such as testing for tail
recursion only on function that require it:

Not to forget that REBOL 1.0 had problems with correctly interpreting some
constructs, when they were recalled recursively. Recall that we had to use
copy on a foreach loop and even then there were problems occassionally.

Elan 



[REBOL] changing server w/set-net (YES!) Re:(3)

1999-11-28 Thread icimjs

Hi Gabriele,

glad to see you back in good "form" (pun itended ;-).

you wrote:
That behaviour is not due to form:


Correct. What is it due to? 

Apparently, the way REBOL treats words in parentheses has changed since
version 1:
Here's what version 1 used to do:

 word: "meaning"
meaning
 var2: make paren! [word]
(word)
 var2
(word)
 :var2
(word)

(This was copied from the Version 1 console: 1.0.3.3 (Win32 x86))

Compare to your experiments:

 word: "meaning"
== "meaning"
 var2: make paren! [word]
== (word)
 var2
== "meaning"
 :var2
== (word)

In version 1 get and evaluation of var2 amounted to the same thing. In the
current version this is no longer true.

How do you account for the difference between:
 :var2
== (word)

and 

 var2
== "meaning"

?

Using :var2 returns something different from evaluating var2. However, the
new User's Guide (beta) continues to say:

User's Guid (beta)
:word   Retrieve the word's value, but don't evaluate it.
This is useful for referring to functions and other
types of data without evaluating them.

So, everything would be peachy, if (word) was covered by the vague "... and
other types of data ...". Is a word in parentheses a type of data that is
evaluated? Not according to the dictionary:

"PAREN!

Represents the PAREN datatype, both externally to the user and internally
within the system. When supplied as an argument to the MAKE function, it
specifies the type of value to be created. When provided within the
specification of the argument of a function, it requests the interpreter to
check that the argument value is of the specified type when the function is
evaluated. "

For our discussion it is important to note that the dictionary does not
document a usage of paren! which leads to the evaluation of a word. My
guess is that was introduced after 1.0. Version 2.1 already includes the
new way (word) works. 

I'd say the dictionary needs to be updated. BTW, if anyone from the REBOL
crew is reading along, the following statement in the dictionary entry for
PAREN! also needs to be carefully reworded ;-):

"When provided within the specification of the argument of a function, it
requests the interpreter to check that the argument value is of the
specified type when the function is evaluated. "

That was never true. 

Elan



[REBOL] Encouraging functional programming Re:

1999-11-28 Thread joel . neely

[EMAIL PROTECTED] wrote:
 
 Ladislav asked for some functional programming in REBOL, so I've
 come up with a challenge.
 
  ...
 
 3.  Return a block of the strings present in this structure:
 [[[3 "hello"] [6 "world"] [7 "from" "rebol" 21]]
  [[["hi"] ["this" ['aword] "is"] "a"] "test"]]
 
 (answer is ["hello" "world" "from" "rebol" "hi" "this"
 "is" "a" "test"])
 
 As it turns out, it isn't possible to do this in REBOL with
 purely functional code because there doesn't seem to be a way
 to prepend an element to a block in a non-destructive way.

I haven't seen any responses to challenge #3 (although my email
reading has been spotty, thanks to some turkey...) so the following
is my first posted stab at it.  Critiques on performance and style
are welcome, as I am still working on which ideas in PROLOG, LISP,
etc. are viable in REBOL and which need to be re-thought.

NB:  I consider these "functional" -- although local variables are
utilized -- because the locals are only initialized once and are
never REassigned.  This is well-known shorthand (e.g. "let" from
LISP/SCHEME) where

foo: func [arg /local temp] [
temp: (... some expression1 on arg ...)
(... some expression2 on temp ...)
]

is just a syntactical (and likely a bit faster) variation of

baz: func [arg2] [
(... some expression2 on arg2 ...)
]

foo: func [arg1] [
baz (... some expression1 on arg1 ...)
]

because it uses local definition and expression evaluation instead of
(secondary) argument definition and function invocation to do the same
computation.

;
; transform a (not string!) series (block?, list?, ...) so that
; the first member is un-nested
;

pinch: func [arg /local front] [
either all [
series? arg
series? front: first arg
not any-string? front
][
pinch compose [(first front) (next front) (next arg)]
][
arg
]
]

 pinch [[["hello" 0] "world" 1] [2 "!" 3]]
== ["hello" 0 "world" 1 [2 "!" 3]]

;
; flatten a (not string!) series? by concatenating the first
; element of the pinched argument with the flattened remainder
; of the pinched argument
;
; non-series arguments, string arguments, or empty arguments are
; their own flattened selves
;

flatten:  func [arg /local loc] [
either all [
series? arg
not any-string? arg
not empty? arg
][
loc: pinch arg
compose [(first loc) (flatten next loc)]
][
arg
]
]

 flatten [[["hello" 0] "world" 1] [2 "!" 3]]
== ["hello" 0 "world" 1 2 "!" 3]

;
; recursively create a result that consists of only the strings
; from the original argument 
;

_onlystrings: func [arg] [
either empty? arg [
arg
][
either any-string? first arg [
compose [(first arg) (_onlystrings next arg)]
][
_onlystrings next arg
]
]
]

;
; produce the block of strings (per challenge #3) by finding the
; strings in the flattened structure
;

onlystrings: func [arg] [
_onlystrings flatten arg
]

 onlystrings [[["hello" 0] "world" 1] [2 "!" 3]]
== ["hello" "world" "!"]
 onlystrings [[[3 "hello"] [6 "world"] [7 "from" "rebol" 21]]
[[[["hi"] ["this" ['aword] "is"] "a"] "test"]]
== ["hello" "world" "from" "rebol" "hi" "this" "is" "a" "test"]

Thus I think it IS possible to do challenge #3 in REBOL.

-jn-



[REBOL] Interface and Implementation Re:(4)

1999-11-28 Thread Al . Bri

Gabriele wrote:
 Andrew, I thought you had learned that there's so much difference
between C++ and REBOL... ;-)

So had I! :-)

 REBOL's objects are just contexts; being your 't correctly bound to
the right context, it evaluates to the correct value.

My C++ experience just shouted out to me, "Bad code! Bad code!"

Andrew Martin
Who's still tripping over his own experience...
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
--



[REBOL] Q on Array of Objects Re:(5)

1999-11-28 Thread Al . Bri

Andrew wrote:
 Words in objects which refer to functions are copied. Therefore the
object will be bigger than expected.

Ingo wrote:
 Seems logical, given that functions are the same as data in Rebol,
but it would be nice to have them only once for a set of equal objects,
..

Yes. I'm thinking there should be a way of recreating objects so as to
have sort of ability. It would probably mean loosing the ability to mix
code and data. Something like the Interface and Implementation objects
I posted earlier.

Andrew Martin
It's all blocks anyway...
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
--



[REBOL] cookies Re:(3)

1999-11-28 Thread Al . Bri

Graham wrote:
 Anyway, I've got it so that the script logs on to MTNSMS's password
page, grabs the session and persistent cookies, and then posts the
message with these cookies to the send-message asp script.  End result
- my cellphone rings with a text message!
 
 It looks ugly, but it works.

Can you post your script to the list (if it's really ugly), or to
REBOL.org (if it's not too ugly), please?

Andrew Martin
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
--



[REBOL] My last message about text file manipulation was ment to be a Q!

1999-11-28 Thread micce

So how would you solve the problem in REBOL?

--
 Mikael Östergren
 [EMAIL PROTECTED]
 mob: +46 (70) 555 4431
 fax: +46 (8) 5981 5932
 voice box: +46 (8) 5981 5932



[REBOL] My last message about text file manipulation was ment to be aQ! Re:

1999-11-28 Thread azajonc

Without showing some code, it's not likly to get any better. And we already
know you are new :)

August


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 28, 1999 6:12 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] My last message about text file manipulation was ment
to be aQ!


So how would you solve the problem in REBOL?

--
 Mikael Östergren
 [EMAIL PROTECTED]
 mob: +46 (70) 555 4431
 fax: +46 (8) 5981 5932
 voice box: +46 (8) 5981 5932



[REBOL] I'm a beginner :-) Text file manipulation. Re:

1999-11-28 Thread icimjs

Hi Mikael,

one simple way to do it:

result: make block! 100

remove-these: [ 
  "get rid of this"
  "remove this"
]

foreach line read/lines %test.txt [
  foreach pattern remove-these [
if found? find line pattern [clear line]
  ]
  if  length? line 0 [append/only result line]
]

Note that this implementation wil skip empty lines in the log file!

Using this example file - test.txt:
This is line 1 remove this
this is line 2
this is line 3 
this is line 4 remove this
this is line 5 get rid of this
this is line 6
this is line 7
this is line 8 get rid of this
this is line 9
this is line 10 remove this


We get the following results:

 foreach line result [print line]
this is line 2
this is line 3
this is line 6
this is line 7
this is line 9



At 02:33 AM 11/29/99 +0100, you wrote:
I've just started out with some REBOL programming and the first task I was
planning to solve is this:

I got a backup log that I want to filter out all rows that match a set of
strings.

1. Open a text file
2. Compare every line with all strings. And if match delete row.
3. Write file back to disk.

I've got a little bit of code doing this with one match string today :-) But
I'm not going to show you how I did :-) Ugly code... I believe.

Thanks :-)

--
 Mikael Östergren
 [EMAIL PROTECTED]
 mob: +46 (70) 555 4431
 fax: +46 (8) 5981 5932
 voice box: +46 (8) 5981 5932






[REBOL] I'm a beginner :-) Text file manipulation. Re:

1999-11-28 Thread icimjs

Hi Mikael,

I forgot to mention:

Use write/lines to write the results of my previous example back to file:

write/lines %filtered-log.txt result

Elan


At 02:33 AM 11/29/99 +0100, you wrote:
I've just started out with some REBOL programming and the first task I was
planning to solve is this:

I got a backup log that I want to filter out all rows that match a set of
strings.

1. Open a text file
2. Compare every line with all strings. And if match delete row.
3. Write file back to disk.

I've got a little bit of code doing this with one match string today :-) But
I'm not going to show you how I did :-) Ugly code... I believe.

Thanks :-)

--
 Mikael Östergren
 [EMAIL PROTECTED]
 mob: +46 (70) 555 4431
 fax: +46 (8) 5981 5932
 voice box: +46 (8) 5981 5932






[REBOL] ZOMBIES? Re:

1999-11-28 Thread carl

Sorry, I'm way behind in my email these days... and did not
see an answer for you on this one

Answer: 

All non-interactive REBOL sessions will, by default, quit
when an error occurs.  (To know what happened, redirect the
output of such scripts to a log file.  You can use "" in
many OSes to append to the log each time.  Also, some CGI
servers will create their own log file that you can look at.)

If your server runs a CGI script in (-cs or --cgi modes)
and blows up, it should quit and release the process.

If your system is not doing this, then please report it as
a bug to [EMAIL PROTECTED]  Be sure to tell us what version,
etc. etc.

-Carl

Docs: we should add this to my manual/operations chapter if
it's not already mentioned there.


At 11/17/99 04:57 PM -0500, you wrote:


My web-server admin called today and said that multiple
(dead) processes of my rebol-cgi scripts were hogging CPU.

This is because I wrote a bunch of scripts in a hurray yesterday
and never tested them. Then they blew up and

The web-server in question  is running SOLARIS/sparc version. 2.2

QUESTION: How do I force rebol to quit every time after running.

What if it never gets to the "quit" word and blows up?

Any command line switches??
Any other suggestions?

- doug
 



[REBOL] problem with lesser?

1999-11-28 Thread Alexander . Grimm




Hi,

i have a problem with the input values for lesser?
it should take any type of value. Anyway, used with sort i get an error , but
why ?:

list: [
[%readme.txt 4-Sep-1998/5:37:08+1:00 139 file "^/"]
[%user.r 26-Nov-1999/17:08:58+1:00 330 file "^/"]
]

i can compare the date in that way :

lesser? (second (first list)) (second (second list))
== true

but if i use sort/compare:

 sort/compare list func [a b] [lesser? (second a) (second b)]

i get following error:

** Script Error: Cannot use lesser? on date! value.
** Where: lesser? (second a) (second b)



Mit freundlichen Gruessen - Yours sincerely

Alexander Grimm
GE CompuNet Computer Distribution

Europaring 34-40, 50170 Kerpen, Germany
Phone: 02273/597-684, Fax: 02273/597-570,
Internet: [EMAIL PROTECTED]


This email is confidential. If you are not the intended recipient,
you must not disclose or use the information contained in it.
If you have received this mail in error, please tell us
immediately by return email and delete the document.




[REBOL] cookies Re:(4)

1999-11-28 Thread anon_emouse

In article 19991129005924.QBMP1752249.mta2-rme@andrew,
[EMAIL PROTECTED] writes
Can you post your script to the list (if it's really ugly), or to
REBOL.org (if it's not too ugly), please?

Andrew Martin

I'll post here as it really needs redoing.  In Andrew Grossman's
cookies-client.r script on Rebol.org, his main word http-cookie took a
block of name value pairs and sent them to a url as url-encoded cookies.

I copied the word definition so that there are three words with slightly
different functions.

tmp: http-get url [ name1 cookie1 name2 cookie2 .. ] - which fetches the
page specified by url as well as sending the cookies in the header.
This word is untested.

tmp: http-post url [ name1 value1 name2 value2 .. ] - which posts the
name/value pairs to the form at url.  No cookies are sent, but up to 2
cookies sent back are saved in a global variable cookie-data, and the
other one in tmp/set-cookie

tmp: http-post-cookie url [ name1 value1 name2 value2 .. ] - which posts
the name/value pairs to the form at url.  Cookies saved in cookie-data,
and in cookie-data2 in url-encoded format are sent as part of the
header.  Cookies returned are saved.

It would be nice if one of the experts here could fold these words back
into a single word - they share 99% of the same code!

MTNSMS' webserver gave a 500 error when I sent them an empty cookie:
header hence the workround making two words.

[ Section: 1/1 File: cookies-client.r UUencoded by: Turnpike Integrated Version 4.02 U 
]

begin 644 cookies-client.r
M4D5"3TP@6PH@("`@5ET;4Z("`B0V]O:VEE($-L:65N="(*("`@($9I;4Z
M("`@)6-O;VMI97,M8VQI96YT+G(*("`@($%U=AOCH@6R)-87)T:6X@2F]H
M86YN97-S;VXB(")!;F1R97@1W)OW-M86XB(")'F%H86T@0VAI=2(@70H@
M("`@16UA:6PZ("!;(=R;W-S9]G01AG1M;W5T:"YE9'4@9V-H:75`8V]M
MMAF]R:2YC;RYNB!="B`@("!$871E.B`@(%L@,#4M075G+3$Y.3D@,C8M
M3F]V+3$Y.3D@70H@("`@"B`@("!0=7)P;W-E.B!["B`@("`@("`@5\@9W)A
M8B!C;V]K:65S(9R;VT@=AE('-EG9EB!A;F0@]S="!F;W)M(1A=$N
M"B`@("!]"B`@("!.;W1ESH@("!["B`@("`@("`@36]D:69I8V%T:6]N(]F
M($%N9')E=R!'F]SVUA;B=S(-O;VMI97,M8VQI96YT('-CFEP="!B2!'
MF%H86T@0VAI=2X@"B`@("`@("`@36]D:69I8V%T:6]N(]F($UAG1I;B!*
M;VAA;FYEW-O;B=S(%!/4U0@V-R:7!T()Y($%N9')E=R!'F]SVUA;BX*
M("`@("`@("!/FEG+B!A=F%I;%B;4@870@=W=W+G)E8F]L+F-O;2!I;B!U
MV5RR@;EBF%R2X*("`@('T*("`@(%5S86=E.B`@('L*"51H97)E(%R
M92!T:')E92!W;W)DR!H97)E('=H:6-H(%R92!V97)Y('-I;6EL87(@:6X@
M9G5N8W1I;VX*"4A45%`M1T54"B`@("`@("`@5\@9F5T8V@@82!W96(@%G
M92!T:%T(')E75IF5S($@8V]O:VEE(]F(YA;64@(F9O;R(@86YD('9A
M;'5E(")B87(B.@H*("`@("`@(`ET;7`Z(AT='`M9V5T(AT='`Z+R]S97)V
M97(N8V]M+W!A9V4N:'1M;"!;(F9O;R(@(F)AB)="@H@("`@("`@(%1O('9I
M97@=AE(')EW5L=EN9R!P86=E.@H@("`@("`@("`@("!PFEN="!T;7`O
M8V]N=5N=`H)268@;F\@8V]O:VEE(ES(')E75IF5D+"!UV4@86X@96UP
M='D@;ES="!AR!T:4@%R86UE=5R"B`@("`@("`@=UP.B!H='1P+6=E
M="!H='1P.B\OV5R=F5R+F-O;2]P86=E+FAT;6P@6UT*"@E(5%10+5!/4U0*
M"51O('!OW0@=F%L=65S('1O($@=V5B(9OFT@=AA="!D;V5S(YO="!R
M97%U:7)E(-O;VMI97,@V5T"@H@("`@("`@('1M#H@:'1T"UP;W-T(AT
M='`Z+R]S97)V97(N8V]M+W!A9V4N:'1M;"!;(FYA;64Q(B`B=F%L=64Q(B`B
M;F%M93(B(")V86QU93(B("XN+B!="@H)3F]T92!T:%T('1H92!N86UE(%N
M9"!V86QU97,@%IG,@=VEL;"!B92!UFP@96YC;V1E9"!B2!H='1P+7!O
MW0*"4EF(-O;VMI97,@87)E(')E='5R;F5D+"!T:5N(]N92!IR!P;%C
M960@:6YT;R!C;V]K:64M9%T82P@86YD('1H92!O=AEB!IPH)86-C97-S
M:6)L92!AR!T;7`OV5T+6-O;VMI90H*"4A45%`M4$]35$,*"51O('!OW0@
M=F%L=65S('1O($@=V5B(9OFT@=AA="!R97%U:7)ER!C;V]K:65S('-E
M=`H*"5!R97-E="!T:4@8V]O:VEER!V86QU97,@:6X@9VQO8F%L('9AFEA
M8FQER!C;V]K:64M9%T82P@8V]O:VEE+61A=$R"@H@("`@("`@('1M#H@
M:'1T"UP;W-T8R!H='1P.B\OV5R=F5R+F-O;2]P86=E+FAT;6P@6R)N86UE
M,2(@(G9A;'5E,2(@(FYA;64R(B`B=F%L=64R(B`N+BX@70H*"4YO=4@=AA
M="!T:4@;F%M92!A;F0@=F%L=65S('!A:7)S('=I;P@8F4@=7)L(5N8V]D
M960@8GD@:'1T"UP;W-T+"!A;F0@=AE(`H)8V]O:VEER!M=7-T()E('!R
M92UUFQE;F-O95D+@H)268@8V]O:VEER!AF4@F5T=7)N960L('1H96X@
M;VYE(ES('!L86-E9"!I;G1O(-O;VMI92UD871A+"!A;F0@=AE(]T:5R
M(ES"@EA8V-EW-I8FQE(%S('1M"]S970M8V]O:VEE"B`@("!]"B`@("!#
M871E9V]R3H@6W=E8B!U=EL:71Y70I=(`H*8V]O:VEE+61A=$Z("(B"F-O
M;VMI92UD871A,CH@(B(*"G5R;"UE;F-O94Z(9U;F,@6PH@("`@U523"UE
M;F-O94@82!S=')I;F=]"B`@("!D871A(")3=')I;F@=\@96YC;V1E(@H@
M("`@+VQO8V%L(YE=RUD871A"EU;"B`@("!N97M9%T83H@;6%K92!S=')I
M;FA("(B"B`@("!N;W)M86PM8VAACH@8VAAG-E="!;"B`@("`@("`@(R)!
M(B`M(",B6B(@(R)A(B`M(",BB(*("`@("`@("`C(D`B(",B+B(@(R(J(B`C
M(BTB(",B7R(*("`@("`@("`C(C`B("T@(R(Y(@H@("`@70H@("`@:68@;F]T
M('-TFEN9S\@9%T82!;F5T=7)N(YE=RUD871A70H@("`@9F]R86QL(1A
M=$@6PH@("`@("`@(%P5N9"!N97M9%T82!E:71H97(@9FEN9"!N;W)M
M86PM8VAAB!F:7)S="!D871A(%L*("`@("`@("`@("`@9FERW0@9%T80H@
M("`@("`@(%U;"B`@("`@("`@("`@(')E:F]I;B!;(B4B('1O+7-TFEN9R!S
M:VEP('1A:6P@*'1O+6AE"!T;RUI;G1E9V5R(9IG-T(1A=$I("TR70H@
M("`@("`@(%T*("`@(%T*("`@(YE=RUD871A"ET*"FAT='`M]S=#H@9G5N
M8R!;"B`@("![4]S="!A(9OFT@=\@82!W96(@V5R=F5R('=I=AO=70@
M:6YC;'5D:6YG(-O;VMI92!I;B!T:4@:5A95R(9OB!I95N=EF:6-A
M=EO;GT*("`@('5R;"`B5AE(%523"(*("`@(1A=$@6V)L;V-K(5T@(D$@
M8FQO8VL@;V8@;F%M92]V86QU92!P86ERR!T;R!R97!R97-E;G0@=AE(9O
MFT@9%T82(*("`@("]L;V-A;"`*("`@(5N8V]D960M9%T80H@("`@]R
M="US5C"B`@("!(5%10+5!OW0M25A95R"B`@("!H='1P+7)E75EW0*

[REBOL] problem with lesser? Re:

1999-11-28 Thread icimjs

Hi Alexander,

Your return value is strange. I tried it on my machine and I get:
 list: [
[[%readme.txt 4-Sep-1998/5:37:08+1:00 139 file "^/"]
[[%user.r 26-Nov-1999/17:08:58+1:00 330 file "^/"]
[]
== [[%readme.txt 4-Sep-1998/5:37:08+1:00 139 file "^/"] [%user.r
26-Nov-1999/17:08:58+1:00 330 fil
e "^/"]
]
  sort/compare list func [a b] [lesser? (second a) (second b)]
== [[%readme.txt 4-Sep-1998/5:37:08+1:00 139 file "^/"] [%user.r
26-Nov-1999/17:08:58+1:00 330 fil
e "^/"]
]


Appears to work here.

Elan

At 07:47 AM 11/29/99 +0100, you wrote:



Hi,

i have a problem with the input values for lesser?
it should take any type of value. Anyway, used with sort i get an error , but
why ?:

list: [
[%readme.txt 4-Sep-1998/5:37:08+1:00 139 file "^/"]
[%user.r 26-Nov-1999/17:08:58+1:00 330 file "^/"]
]

i can compare the date in that way :

lesser? (second (first list)) (second (second list))
== true

but if i use sort/compare:

 sort/compare list func [a b] [lesser? (second a) (second b)]

i get following error:

** Script Error: Cannot use lesser? on date! value.
** Where: lesser? (second a) (second b)



Mit freundlichen Gruessen - Yours sincerely

Alexander Grimm
GE CompuNet Computer Distribution

Europaring 34-40, 50170 Kerpen, Germany
Phone: 02273/597-684, Fax: 02273/597-570,
Internet: [EMAIL PROTECTED]


This email is confidential. If you are not the intended recipient,
you must not disclose or use the information contained in it.
If you have received this mail in error, please tell us
immediately by return email and delete the document.