1. Can you tell I reply to the whole digest?

[Type]
type  positive_integer ( object x )

    if integer(x) then
        if x > 0 then
             return 1
        end if
                end if
    puts(2, "\nA positive_integer must be an integer greater than 0\n")
    ?  x
    puts(2,"is not an integer.\n\n")
    return 0
end if
You can do anything that you would normally do in a procedure in a type. I even
 had
a type one time that if it recieved a graphics cusor placement of the screen
 scroll
the entire screen.

[Future Types]
I agree with Arthur Adamson one byte instead of always four would be good, but
 Rob
said:
> In the past, I've concluded that 1 byte per element is very difficult to
 achieve
without slowing down execution speed, or making the interpreter a lot bigger and
buggier. <
Oh well.

I wrote :
> Type is used to restrict the data type is euphoria, if you've decided you need
a sequence containg numbers and sequences you don't want the numbers being
 sequences.
<
And it is helpful when programming libraries if you know there is going to be no
sequence in your sequence if say you want to poke it into mem.

[300 Line Limit]
<Hang Head> I haven't Registered </HH>, but I'm a poor Uni student, and I mean
 that.
I had the money but for reasons I will not go into I didn't register. I always
 get
hit by the three hundred limit, but then I just remember most languages are not
 even
this helpful and work my way atround it. ?ing a variable while redirecting
 STDOUT
to a file is always helpful. But a Count.Ex to count the lines in a
 library/program
would be helpful, or with count would be OK. except I always find ex.pro and
 ex.err
all over my C drive.
> Your program has to get pretty complex before you reach  the 300 statements
 limit.
<
I must always do complex work, Eu includes the libraries in the count BTW.
And Hey I may register soon, but my 3rd year at uni is leaning towards maybe not
so I don't know if I will, that and the I'm waiting for the exchange rate to
 rise
a little more.

[Euphoria's Strong Suit]
It's flexibility. I wrote an interpreter in Euphoria. It was easy (well
 easy-ish)
because I didn't have to work with the, lets be honest, primitive data types of
 other
languages.
Oh and as Pete pointed out: what you can do to the sequence is also a strong
 point.
Can you add stuff to the end of an array in C.
And length() is pretty handy, especially since it is direct access to a number.

[Bug]
> gets() is supposed to return the whole line including '\n' if there is one.
 The
last line in a file might not have a '\n', so gets() will return all the
 characters
on that line, but there won't be a '\n' on the end. <
Not in my experience Rob.

[Consideration]
> There are also the people who are excluded because they don't have the  most
 current
hardware. Not everyone has a 200Mhz Pentium, or a SVGA monitor. <
I'm one, 486DX2/66Mhz, 8MB Ram, 540MB HDD, and DOS 6.22 with Win3.11.

[Advanced Help (For Me Please) ]
Can any one help me on this one:
1.) How do I pass an pointer too a DOS interupt give the address returned by
 Euphoria
allocate or do I have to Machine code it, which I don't know how.
2.) How do you has been revectored to the Error interupt or is a Null Vector.
3.) And If I write a software interrupt (TSR Probablely) to handle say shared
 mem
(yes this is for Eu) if the interrupt is called is called will execution be
 passed
to the main function afterwards or what? That is I write a TSR it attaches
 itself
to an unused interrupt. It is then called it allocates some mem, stores a
 pointer
to it, the sends that pointer back to the caller.  Will main automatically be
 prossed
every time the INT is.
4.) How do you execute machine code with an int/tsr, considering it will
 probablely
be the users machine code.

---
Sincerely,
Mathew Hounsell
Mat.Hounsell at mailexcite.com

P.S I intend to write an array library for euphoria this sunday.




Free web-based email, Forever, From anywhere!
http://www.mailexcite.com

new topic     » topic index » view message » categorize

2. Re: Can you tell I reply to the whole digest?

At 04:48 AM 4/28/98 -0700, Mathew Hounsel wrote:

>You can do anything that you would normally do in a
>procedure in a type.

Yes. procedure -- not function. Sometimes it would be
nice if type could return a value.
As it is now, it returns (I think) a flag, saying: ok, make the
assignment, or not_ok , so abort with error.

example:
type max5 (object x)
 return (x < 6)
end type

if you define a variable : max5 temp, then try to say :
temp = 6, you'll get an error. Wouldn't it be nice to
have a value of 5 returned?
Of course you can write a function to do this, but then
you have to make all assignments as follows:
temp = max5(6)    urk!

The reason I suggest this at all, is I don't think it
would "break" any existing code, and it would be
kinda handy. Besides: Rob is free to ignore any
and all suggestions if he wishes. His e-mail program
has a delete button, methinks.

Irv

new topic     » goto parent     » topic index » view message » categorize

3. Re: Can you tell I reply to the whole digest?

>>You can do anything that you would normally do in a
>>procedure in a type.
>
>Yes. procedure -- not function. Sometimes it would be
>nice if type could return a value.
>As it is now, it returns (I think) a flag, saying: ok, make the
>assignment, or not_ok , so abort with error.

However you *can* call it just like any other function if you wonder if some
value could be considered to be of a certain type.


>example:
>type max5 (object x)
> return (x < 6)
>end type

Now you say this:

function beneath6 (object x)
    if not max5 (x) then
        x = 5
    end if
    return x
end function

It doesn't really help a lot, but I wanted to show you it *could* break any
existing code, at least when it wants to change the value to zero.  The
value is already used. That's why I think it is wrong to be able to declare
a type with anything else besides an object. It would crash instead of
return FALSE.

Example:

if integer ("Yes!") then
    puts (1, "No its not!"
end if

type max5 (integer x)
    return x < 6
end type

if max5 ("Yes!") then
    puts (1, "What ?? Didn't you crash?? ")
end if

It should print out nothing, instead the second if-statement generates a
crash.

>The reason I suggest this at all, is I don't think it
>would "break" any existing code, and it would be
>kinda handy.

It would break it, but I too must admit, it would be neat. Another way it
could break existing code is: when you turn type_check off you could
generate an error whereas it would run perfectly with type_check on. However
now, your program will crash in both cases, but the type_check would give
you better information what caused *really* caused the error, instead of the
statement that generated it.

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

BTW- Arthur, thanks for your comments. But I suppose being on this list
server (and the internet and turorials in general) is a *very* good thing
for my English.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu