[REBOL] hash Re:

2000-04-15 Thread robert . muench

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 14, 2000 11:57 AM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] hash

 is there anybody who can explain me hash value.
 what it is used for, how it works etc.

Hi, as I understand it, the datatype is just like a block from a
functional point of view but supports fast lookup for key/value pairs.
So if you have an even number of key/value pairs inside a hash! and
use find, it will use a binary-tree search approach, much faster than
a sequential search through the block.

Hope this helps...

Robert M. Muench, Karlsruhe, Germany
== ask for PGP public-key ==

  When do you want to reboot today?

Use the free portable GUI Library
OpenAmulet from http://www.openip.org




[REBOL] Re: Parse Re:

2000-04-15 Thread giesse

Hello [EMAIL PROTECTED]!

On 14-Apr-00, you wrote:

 A  if any [
 A   C == #"A"
 A   C == #"B"
 A   C == #"C"
 A   C == #"D"
 A   C == #"E"
 A   C == #"F"
 A   C == #"G"
 A   C == #"H"
 A   C == #"I"
 A   C == #"J"
 A   C == #"K"
 A   C == #"L"
 A   C == #"M"
 A   C == #"N"
 A   C == #"O"
 A   C == #"P"
 A   C == #"Q"
 A   C == #"R"
 A   C == #"S"
 A   C == #"T"
 A   C == #"U"
 A   C == #"V"
 A   C == #"W"
 A   C == #"X"
 A   C == #"Y"
 A   C == #"Z"
 A   ] [

Hmmm... this seems a bit crazy to me... ;-) What about:

if all [C  #"A" C  #"Z"] [ ... ]

Anyway, with parse:

 upper: charset [#"A" - #"Z"]
== make bitset! #{
FE07
}
 line: "ThisIsTheLine"
== "ThisIsTheLine"
 parse line [skip some [here: upper (insert here " ") skip | skip]]
== true
 line
== "This Is The Line"

Regards,
Gabriele.
-- 
Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/




[REBOL] Parse Re:(3)

2000-04-15 Thread Al . Bri

Gabriele wrote:
  A   C == #"Y"
  A   C == #"Z"
  A   ] [

 Hmmm... this seems a bit crazy to me... ;-) What about:

 if all [C  #"A" C  #"Z"] [ ... ]

Actually, I tried a approach very similar to that, but I seemed to get a
result that indicated that the comparison was case _insensitive_. And seeing
as I was in a rush (a bad state for writing software in...), and my tools
made my solution easy to write, I sent it out.
Of course, this is a more accurate test:
all [#"A" = C C = #"Z"]
;-)

Andrew Martin
Tools triumphing over good design... :-(
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
--




[REBOL] webbanner.r help Re:

2000-04-15 Thread icimjs

Hi Ryan,

you wrote:
Original (with three urls in the block)

adnumber - 1 * 3
random (length? banner-db) / 3
make-banner/ad 3]

My changes (with six urls in the block)

adnumber - 1 * 6
random (length? banner-db) / 6
make-banner/ad 6]


The 3 in adnumber - 1 * 3, that 3 does not stand for number of entries in
the database. It stands for the length of a database entry, i.e. each entry
in the database consists of three items:

   http://www.schonder.com  %/graphics/bannerads/schonder.gif
   "Papier-Schonder KG office supply and bookstore"


1. the url:  http://www.schonder.com  
2. the banner file: %/graphics/bannerads/schonder.gif
3. the accomapnying text: "Papier-Schonder KG office supply and bookstore"

You added 3 more companies, fine, you therefotr changed 3 to 6 in your call
to make-banner/ad 6, that's fine, but you now have 18 entries in the
database, six records of length 3 each, and not 36 entries. But when you
call make-banner with the ad refinement, get
adnumber - 1 * 6

is 6 - 1 * 6 = 30. No wonder you get none.




;- Elan  [: - )]