Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: MySQL protocol bug

From: maximo:meteorstudios at: 19-Feb-2004 9:33

> -----Original Message----- > From: Nenad Rakocevic [mailto:[dockimbel--free--fr]] > Sent: Thursday, February 19, 2004 5:50 AM > To: [rebol-list--rebol--com] > Subject: [REBOL] Re: MySQL protocol bug > > BTW, it's funny to see how our personal coding style can > evolve. While > looking at the piece of code you've exposed to show the > problem, I was > thinking how would I wrote that today.
I find this to be more true in rebol than in any other language I've used. I guess its because rebol, being only expressions, can express the same problem differently. Much like any standard math algebra. 1 + 2 = 3 = 4 - 1 = 6 / 2 when using structured languages, they define how the language understands any given concept and it is your problem to adapt your code to that -syntax- or grammar. for example: in python if you want to create a function you MUST use: def funcname (arg): put your code here in rebol, creating a function is an expression! so you usually write:
> funcname: func [arg] [put your code here]
not everyone realizes that you ASSIGN a value to a word (~variable). In the same manner that you use any other function. A value is calculated by the 'func function (which creates a new function VALUE). but you can also do:
> arglist: [arg] > code-block: [put your code here] > funcname: func arglist code-block
> funcname: func append arglist 'arg2 append code-block [print arg2]
hey, thats polymorphism without even having an object! Now, how many languages will handle a stray value in code without choking... not even python will let you insert a string anywhere in its code, if its not being used by a function. Because rebol really is just evaluating expressions as it encouters them one thing at a time, when it hits a string value, for example, IF no previous function required an argument, it is ignored, and evaluation simply continues to the following item of code. python or c would give you a syntax error, because it excepts ALL values to be part of a structure, which is defined by strict syntax and parenthesis useage. When it encouters bogus data, it just cant handle it, cause it differentiates values and functions. IMHO rebol does not. They really are all just values, even functions. I know this is isn't news to any of the fluent rebolers, but once and a while I like to remind the list about these potent rebol features for newcommers. There are many other hidden features which rely on the fact that rebol's syntax is really just concerned with expressions, and with the fact that code IS data, until the exact moment it is evaluated. As all the "modern" language get closer and closer to supporting many of the same features (garbage collecting, objects, dynamic name resolution, etc), I find that rebol, by its expressive nature, stands out. Though, being alone in the dark isn't quite good either. Some MAJOR enterprise or software has to embrace rebol, to let others loose skepticism... and I can't see that happening yet! Whatever happened to the old morpheus deal... -MAx