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 12:35

Hi Joel,
> Pardon my being picky, but we can take your point even > further...
please do!
> Maxim Olivier-Adlhoch wrote: > > Although we *may* write something like that, when we do so > we are actually combining two distinct concepts in one > expression: > > 1) defining a function, and > 2) making a particular word refer to that function.
Which is why we can easily define and create nameless functions on the fly (in other languages too) but how natural is it in other languages. not very. func [arg][print "hello"] is legal in rebol def (arg): print "hello" makes no sense in python, cause you've got a specific SYNTAX for creating functions. yet in rebol, as long as you follow the argument count of ANY function (like 'func or 'print), you're all set. which was my original point. Although, you can eval() code in python, its much less "natural" and friendly than in rebol. Also, rebol handles contexts with much more flexibility (read as head aches, until you understand ;-). I'd like people with experience in scheme or ruby to butt in! I'd like to see how rebol stands out compared to them.
> and the habit of thinking of those two together results in > one of the standard newbie questions: > > "How can I find out the name of this function?" > > which is no more meaninful than asking for "the name" of a > value of any other type. (Of course, that's what it means > to say that functions are first-class values...) > > "How can I find out the name of 2?" > > "How can I find out the name of {Hello, world!}?"
yep!!! nice illustration
> > 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.
should have read: "not even python will let you insert a VALUE OF RANDOM TYPE anywhere in its code" just tested with an integer and python chokes. rebol just goes... but a warning (which could be disabled) could be usefull... I know rebol will choke with a random WORD type, but that's because the interpreter evaluates words specifically... so they SHOULD have a meaning.
> > ... > > 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. > > > > The following (console transcript) shows that one *can* insert > values (e.g. strings) into the body of a Python function when > such values aren't actually used for anything.
read above, won't work with (m)any other type(s)...
> One can do similar things in Perl. The parser will let > you know that the value is not used; surely you don't think > that's all bad???
no, that's a good thing (the warning).
> How many of us have *never* made a typo > in a REBOL script that changed the meaning of something in > a way that produced an error, but the interpreter never > helped us find it?
count: None
> For example, take a largish REBOL script and delete a single > occurrence of '+ somewhere in the middle.
even better, just remove a random SPACE in any expression which sends data to another function! like (1 + 1) vs. (1 +1) I wish rebol could at least tell you in which SCRIPT FILE a crash occurs! when I do large apps which include several files and total code size exceeds 100k (or more), then a random error becomes a random attempt at solving it (generally including 'print until you track the grevious line). This is especially bad when the error comes from a native or a mesanine to which you've supplied erronous data. This is probably my pet peave about rebol <Sigh>... error tracing is very hard to do in an environment which promotes self-modifying code. It could be better if rebol had some kind of stack trace... maybe we could patch (encompass) 'func do to just that... <hummm> -MAx