1. Various subjects

[Get some chars]

Andy Kurnia posted a function called getsc which he would like to have built-in
in
Euphoria. The main reason to this was that the function would not cost any
statements,
but it would also be faster.
Well, I have no solution for the statement count, but here is a version that is
about
50% faster (at least in my computer). The difference is that, in the original
function,
t grows in size each time a new character is read from the file, so it is
necessary to
reallocate space to store the sequence. In this function, all the space needed
is
allocated at the beggining. (see perform.doc)

global function faster_getsc(integer fn, integer len)
    sequence t
    t = repeat(0,len)
    for i = 1 to len do
        t[i]=getc(fn)
    end for

    while length(t) do
        if t[length(t)] != -1 then
            exit
        end if
        t = t[1..length(t) - 1]
    end while
    return t

end function

I hope it will be helpful for someone. If it isn't, just ignore it.



[File Naming in Win95]

The problems with file extensions could be happening because the "Hide MS-DOS
extensions
for registered file types" option is enabled. When it is enabled, Windows 95
won't let
you change the file extension when it is not shown (I'm just guessing, maybe
that's not
the problem). You can find this option in the 'Options' dialog box that can be
accessed
from the Windows Explorer 'View' menu.
About the Wordpad thing, I found out that when you use an extension that is
registered (such as .bmp),
it doesn't write ".txt" or ".doc" after it, otherwise it does. Really useful
feature,
isn't it?
Talking about Wordpad, does anyone know why it won't allow you to open an
executable?


[Euphoria X Perl]
I don't program in Perl, I know nothing about Perl, but I think there is one big
difference that was not pointed out: sequences. Does Perl allow you to create a
sequence
containing atoms and another sequences? That is the biggest difference of
Euphoria when
compared to other languages, and that is what makes Euphoria so easy and
powerful. If Perl
allows it, I'm sorry, but I haven't heard of any other language with this
feature.


BTW [1] , I receive the daily digest, so if anyone replies to this message I'll
probably
not read it until tomorrow.

BTW [2], this is my first post to this list, so please don't hit me too hard if
I said
something wrong...

Regards,
Davi T. Figueiredo
davitf at usa.net


____________________________________________________________________
Get free e-mail and a permanent address at http://www.amexmail.com/?A=1

new topic     » topic index » view message » categorize

2. Re: Various subjects

-----Original Message-----
De: Davi Figueiredo <davitf at USA.NET>
Para: EUPHORIA at cwisserver1.mcs.muohio.edu
<EUPHORIA at cwisserver1.mcs.muohio.edu>
Fecha: viernes 26 de junio de 1998 12:38
Asunto: Various subjects


>[Euphoria X Perl]
>I don't program in Perl, I know nothing about Perl, but I think there is
one big
>difference that was not pointed out: sequences. Does Perl allow you to
create a sequence
>containing atoms and another sequences? That is the biggest difference of
Euphoria when
>compared to other languages, and that is what makes Euphoria so easy and
powerful. If Perl
>allows it, I'm sorry, but I haven't heard of any other language with this
feature.


I don't know Perl, but languages like Lisp and Scheme use "lists" that are
just like our sequences. If my memory dosn't fails Rob said once that one of
Euphoria "inspirations" was Lisp, or alike functional language.

Regards,
    Daniel   Berstein
    daber at pair.com

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

3. Re: Various subjects

At 11:37 26-06-98 -0400, you wrote:
>[Get some chars]
>
>Andy Kurnia posted a function called getsc which he would like to have built-in
>in
>Euphoria. The main reason to this was that the function would not cost any
>statements,
>but it would also be faster.
>Well, I have no solution for the statement count, but here is a version that is
>about
>50% faster (at least in my computer). The difference is that, in the original
>function,
>t grows in size each time a new character is read from the file, so it is
>necessary to
>reallocate space to store the sequence. In this function, all the space needed
>is
>allocated at the beggining. (see perform.doc)
>
>global function faster_getsc(integer fn, integer len)
>    sequence t
>    t = repeat(0,len)
>    for i = 1 to len do
>        t[i]=getc(fn)
>    end for
>
>    while length(t) do
>        if t[length(t)] != -1 then
>            exit
>        end if
>        t = t[1..length(t) - 1]
>    end while
>    return t
>
>end function
>
>I hope it will be helpful for someone. If it isn't, just ignore it.
>
>

another possibilie is

global function faster_getsc(integer fn, integer len)
    sequence t
    integer pos
    t = repeat(0,len)
    for i = 1 to len do
        t[i]=getc(fn)
    end for
    pos = find(-1,t)
    if not post then
      return t
    else
      return t[1..pos-1]
    end if
end function




Jacques Deschenes
Baie-Comeau, Quebec
Canada
desja at globetrotter.qc.ca

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

4. Re: Various subjects

Salutations,

>[File Naming in Win95]
>The problems with file extensions could be happening because the "Hide
MS-DOS extensions
>for registered file types" option is enabled. When it is enabled,
Windows 95 won't let
>you change the file extension when it is not shown (I'm just guessing,
maybe that's not
>the problem).

No, I can see the extensions (at least in the save dialoge box).


>You can find this option in the 'Options' dialog box that can be
accessed
>from the Windows Explorer 'View' menu.

Actually this wouldn't help me much anyway because I am using a college
"lab" computer for my email (I'm not connected at home) and these
computers here have a lot of security features including the inabillity
to save options even though the defaults are really annoying.


>About the Wordpad thing, I found out that when you use an extension
that is registered (such as .bmp),
>it doesn't write ".txt" or ".doc" after it, otherwise it does. Really
useful feature,
>isn't it?
>Talking about Wordpad, does anyone know why it won't allow you to open
an executable?

I think that's another "security feature" for copyrighted material.


>BTW [2], this is my first post to this list, so please don't hit me too
hard if I said
>something wrong...

Don't worry, it's really not that easy to say something wrong.
Ralf just makes it seem that way. ;) JK


Sincerely,
Lewis Townsend
|\      ____ _     _     _ _    __
| \    | __/ ||   / |   // || / __ \
|  \   ||_   ||  //||  //  || ||__\|
|   \  | _|  || // || //   || \___ \
| |\ \ ||__  ||//  ||//    || |\__||
| | \ \|___\ |_/   |_/     || \____/
| |  \ \      _____    _______
| |   \ \     | __ \  | _   _ |
| |    \ \    ||__||  |/ | | \|
| |     \ \   | __ /     | |
| |______\ \  ||  \\     | |
|___________\ ||  ||     |_|
Keroltarr at hotmail.com

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu