Re: Fair Criticism, etc

new topic     » topic index » view thread      » older message » newer message

> Speaking of Lua, has anyone compared the Eu interpreters coded in Eu to
> the Lua ability to exec commands stored in strings? Are they as fast? Less
> able? What about nested procedures and functions, and lengths of the
> strings? If Eu has a line length limit, is a string that exceeds this
limit non-
> executeable in the interpreters? So i cannot pass a 1/2 megabyte file to
the
> doubley interpreted Eu, right?
Why couldn't you? You can load an entire file into a single sequence.
EU has a line limit anyways. In my preprocessor I wrote, there is an option
to compact the output file (strips comments, and all unnesseccary
whitespace). The output file is only one line(excluding top level
statements), no line feeds, it executes fine. I've tried it with a file that
was over 100kb, so that's not a problem.

<SNIP>

> One of the huge draws of an interpreter, that places an interpreter heads
and
> tails above a compiled language, is flexability. Exception processing. The
> good ole "if-then"-else go on and do it like we have always done it. This
> would almost be trivial to add, to the interpreter at least, altho i don't
know
> about the translator, cause it's not on my mind at the moment. Internally,
the
> interpreter simply refers to the table as a nested *normal* sequence. If
> additional restrictions need be imposed, that's extra code and processing
> time, but do-able. I vote for no restriction added for the keyword "table"
in
> native code that Rob writes, but expanded typecheck abilities, code that
we
> can write. Added abilities includes altering the contents of the variable
in
> question, and re-typing it. Then anywhere the table is used, you can check
it
> for length, contents, etc, as the coder wishes, the same as we can do now.
Wouldn't a table just be an object?
Functional type checking I definitely agree with. If we were able to modify
a variable that we are type checking, there would be no discussion about
structures.
You could write something like this....

type structure(sequence s)
    if length(s)=0 then s={0,0,0} -- it's a newly defined structure
    elsif not length(s)=3 then return 0
    end if
    if not atom(s[1]) or not atom(s[2]) or not atom(s[3]) then return 0 end
if
    if s[1]<0 then s[1]=0 elsif s[1]>23 then s[1]=23 end if   -- hours
    if s[2]<0 then s[2]=0 elsif s[2]>59 then s[2]=59 end if    -- minutes
    if s[3]<= then s[2]=0 elsif s[2]>59 then s[2]=59 end if    -- seconds
    return {s} -- if type checking returns a sequence, assign the value of
the first element
                   --         to the variable being typechecked
end type

Come on Rob, ya can't disagree with this one.. it's just too easy, and the
benefits are enormous. :)

> This is a little like the "with-do" command. It's not really needed, if
you can
> do this:
>
> global procedure getnetstats(atom netnum)
> sequence ircnet
>   ircnet = serverlist[netnum]
>   -- get the global vars for this net
>     sock = ircnet[1]
> etc etc
>
> I do that for *reading* from a huge nested-nested sequence (serverlist),
but if
> we could also allowed to do the same to *write* to it, the new code would
not
> break anything, and not need an added keyword,, just transparently added
> code internal to the interpreter.
How do you mean? EG?

Chris

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu