Howdy John: 

> I was complaining to Jeff that it is more `procedural' than
> `functional', though.  If  you take a  look  at the scripts
> that people  write, and in  particular the `functions' that
> they write, you will notice that the large majority of them
> work by modifying   either their arguments or some   global
> state  variables (a `procedural'  style).  Very few of them
> are written to  solely return  a new  value based  on their
> arguments ('functional' style).
> 
> I  think this is because  the selection of natives in REBOL
> is heavily  biased towards  `procedural' programming.   You
> *can*  write in a `functional' style  in  REBOL, but if you
> use a  `procedural' style, you  don't have to write as much
> code because there are so many more natives to choose from.

    Let's be fair about it.

        In my estimation, these Natives and Mezzanine Functions do
NOT produce side effects, to their operands or the
interpreter at large:

 ------------------------------------------------------------------

unset?  error?  datatype?  native?  action?  op?  function?  object?
port?  any-type?  any-word?  any-function?  number?  series?
any-string?  any-block?  word?  set-word?  get-word?  lit-word?
refinement?  none?  logic?  integer?  decimal?  money?  time?  date?
char?  tuple?  bitset?  string?  issue?  binary?  file?  email?  url?
tag?  block?  paren?  path?  set-path?  lit-path?  hash?  list?  + - *
/ // ** and or xor =?  = == <> < > <= >= add subtract multiply divide
remainder power and~ or~ xor~ same?  equal?  strict-equal?  not-equal?
strict-not-equal?  greater?  lesser?  greater-or-equal?
lesser-or-equal?  minimum maximum negate complement absolute random
odd?  even?  negative?  positive?  zero?  head tail head?  tail?  next
back skip at index?  length?  pick first second third fourth fifth
last find select to all any bind checksum comment debase dehex
difference disarm do either else enbase exit foreach form get if in
intersect load source loop mold not now parse  prin print recycle
reduce compose repeat return save script? to-hex trace try type?
union until use value?  while compress decompress
 wait input?  exp log-10 log-2 log-e square-root cosine sine tangent
arccosine arcsine arctangent help echo Usage func empty?
throw-on-error function found?  charset to-char info?  exists?  size?
modified?  dir?  probe rejoin reform remold array build-tag to-tag for
forever ? about license upgrade what-dir clean-path list-dir max
split-path to-file to-url ask confirm cvs-date to-date cvs-version
what decode-cgi to-set-word switch parse-xml protect-system to-word
to-get-word to-lit-word to-refinement to-none to-logic to-integer
to-decimal to-money to-time to-tuple to-bitset to-string to-issue
to-binary to-email to-block to-paren to-path to-set-path to-lit-path
to-hash to-list cp net-error parse-header parse-header-date
parse-email-addrs import-email cd to-idate resend min abs
decode-cgi-query make copy query throw break catch 


        This (MUCH SMALLER COLLECTION) of Natives and Mezzanine
functions DO side effect their operands or the interpreter at
large:

 ------------------------------------------------------------------

q insert remove change poke clear trim sort alias reverse
unprotect unset secure entab detab append forall forskip join make-dir
change-dir rename delete replace set-net send protect lowercase
uppercase halt close open read read-io write-io write update 
set quit input

        (I included things like RENAME, which actually doesn't
        side effect the interpreter or one its operands, but is
        called for its desired side effect to the file system.)

         REBOL is a hybrid language, which, if anything, (based on
         numbers alone) is strongly biased towards non side effect
         producing expressions.  

         The idea behind REBOL is to be simple first and foremost,
         and if a task is more easily accomplished with the aid of
         a side effect, then that's what people should to do,
         rather than build deeply nested expressions to tease out
         the desired state of the machine.

         Looking at the scripts people write, so often you see
         stuff like:

            select block first next blk

            back find blk blk2/3/2 

            pick [yes no] random false

         and on and on. These techniques in REBOL are ubiquitous
         and completely functional.  So, you may call it
         'procedural' if you prefer, but I'll stick with
         'functional' as my description of the language. Bash me
         if you must. (-:


          Cheers--
          
          -jeff

Reply via email to