1. more lobbying

Just some ideas:

* Make callback() available in DOS (seems to be an easy task).

* Make it possible to pass floats to C functions (type-casting, eh?).

* Add some sort of define_mach_proc/func(), something like this:
   (a = pointer to machine-code block)
   a = define_mach_func(a, {C_POINTER,C_UCHAR},C_INT)
  and then I would be able to do this:
   i = mach_func(a,{#B8000,10})
  (or perhaps we could use c_proc/func() to call these routines once
   they've been defined?)

* Some sort of definition command would be useful. Example:
   ifdef WIN32
    --Windows code goes here
   endif
   ifdef LINUX
    -- Linux code goes here
   endif

   define short_name(x) very_long_function_name(x)


* Let us do stuff like this:
   atom a = PI/180.0
   sequence s1,s2
   s1 = s2 = {"Plea",se.."}

* Add routines for block-based file i/o:
   s = read_file(handle,size)
   mem_read_file(handle,buffer,size)
   + write routines.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

new topic     » topic index » view message » categorize

2. Re: more lobbying

>    [snip]
>    sequence s1,s2
>    s1 =3D s2 =3D {"Plea",se.."}
>    [snip]

Your last example leaves me completely puzzled. Even though it's fairly o=
bvious that you just forgot a quote from the second element, I don't unde=
rstand what you're trying to do there.
Are you going for an approach of something like this pseudoEu:
{s1, s2} =3D {"plea","se"}
which would set s1 to "plea" and s2 to "se."

Or are you working on the perlish assumption that the assignment op alway=
s returns its own left-value?

Or am I just not playing with a full deck here? ;)


And now that I'm at it, I might as well throw in my $.02:

--Regular expressions.
I'm still an advocate for this. Just rip the bugger out of the perl packa=
ge if you have to ;)
Seriously speaking, regexp would be a great functionality for Euphoria. L=
et's take over some territory from Perl!
 mean, think about it, with a powerful regexp system and simple UN-QUIRKY=
 grammar, Euphoria would beat the crap out of Perl any time of day.
No more having to produce (or read) code like:
defined($params[1]) && do{$params[1] =3D~ /^PARAM=3D.*/i ? do{(@subparams=
[1] =3D (&split_params($params[1], '\=3D'))[1])}:do{print "ERROR: PARAM E=
RROR $params[1]\n";goto FROB;};};
And other such drivel, which I and many others regularly produce just to =
keep our jobs ;)



--Function subscription and slicing.
This has been talked about before, I know.
I just fail to understand the difference between writing

temp =3D returns_a_two_element_sequence(zok)
puts(1,temp[1])

instead of just going
puts(1, returns_a_two_element_sequence(zok)[1])
The other value is going to get thrown away anyhow, so why not allow us t=
o do it quicker?


--Goto
(Don't snicker, I'm dead serious ;)
Really, it IS useful in certain situations. Sure, they _can_ be handled i=
n more "elegant" ways, but it gets complicated. A LOT.




Allright, now I'll just lie right here and wait for the flames to rise.



--Tom "Mr. Wizard" Ekl=F6f


Tiesitk=F6, ett=E4 Sunpoint.netin k=E4ytt=E4j=E4t voivat lukea s=E4hk=F6p=
ostinsa my=F6s WAP-puhelimella.
  http://www.sunpoint.net/SunAds/click.htm?mode=3Dfooter&id=3D&jump=3Dhtt=
p%3A%2F%2Fwww.sunpoint.net%2Fwap%2F

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

3. Re: more lobbying

> >    [snip]
> >    sequence s1,s2
> >    s1 = s2 = {"Plea",se.."}
> >    [snip]
>
>Your last example leaves me completely puzzled. Even though it's fairly
>obvious that you just forgot a quote from the second element, I don't
>understand what you're trying to do there.
>Are you going for an approach of something like this pseudoEu:
>{s1, s2} = {"plea","se"}
>which would set s1 to "plea" and s2 to "se."


No, the above code is supposed to be equivalent to:
s2 = {"Plea","se.."}
s1 = s2


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

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

4. Re: more lobbying

Tom Ekl=F6f wrote:

> --Regular expressions.

I had hacked together a regexp routine a while back; it's actually fairly
sophisticated. I can't guarantee it to be complete or bug-free, however. =
I
don't really use it, so I'm not really the best person to maintain it.

If it doesn't meet your needs, I'd be glad to see if it can be extender, =
or
explain any mysteries about it if you want to take over development on it.
smile

-- David Cuny

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

5. Re: more lobbying

mic wrote:

> * Make callback() available in DOS
> (seems to be an easy task).

This might be nice, but what system are you proposing to base it on? The
most popular one that I've seen isn't even in development any more.


> * Make it possible to pass floats
> to C functions (type-casting, eh?).

That can't be done? <mildly shocked expression>


> * Some sort of definition command would
> be useful.

I was under the mistaken impression that simply including a routine not
available on a platform (like open_dll on Dos32) would cause an error.
However, since you only get an error when you _call_ the routine, writing
something like this:

   procedure my_func()
      if platform() = DOS32 then
         -- dos specific stuff
      elsif platform() = WIN32 then
         -- windows specific stuff
      elsif platform() = LINUX then
         -- linux specific stuff
      else
         -- error
      end if
   end procedure

So there's less of a need for it than you might thing.

-- David Cuny

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

6. Re: more lobbying

Mic writes:

> * Make it possible to pass floats to C functions
> (type-casting, eh?).

Currently only C doubles (64-bit) are fully supported,
not C floats (32-bit).  Floats are not used in C nearly as
much as doubles. I intend to support floats fully in the
next release. Until then you can use the following
workaround that David Guy and I discovered last January.

The rest is a message that David Guy posted to this list...

------------------------------------------

On Wed, 19 Jan 2000 21:13:26 -0500, Robert Craig <rds at ATTCANADA.NET>
wrote:

>David Guy writes:
>> How do I pass a 4-byte floating point value from
>> Euphoria to a C routine?
>
>Euphoria only supports passing floating-point atoms to C routines
>in the form of C doubles (8 bytes). From my experience,
>it's extremely rare that a C routine will pass float arguments
>(4-bytes), and even if it did, I believed (until now) that most,
>if not all, C compilers automatically promote float arguments
>to double before passing them. I suppose I could support
>passing atoms as C floats in the next release.
>
>Meanwhile, here's a kludge that you can try.
>- convert each argument, a, as:
>         a = bytes_to_int(atom_to_float32(a))
>
>- define the C function in Euphoria as if it takes C_INT's
>  as arguments
>
>- pass each argument, a, as a C_INT

You're kludge works! :)

If I "link" to the routine in either of the following ways:

  constant m_myFunc = define_c_proc(m_DLL, "_myFunc@8", {C_FLOAT,
C_FLOAT})
    or
  constant m_myFunc = define_c_proc(m_DLL, "_myFunc@8", {C_INT,
C_INT})

and then call the routine like so:

  c_proc(m_myFunc,
    {bytes_to_int(atom_to_float32(1.0)),
     bytes_to_int(atom_to_float32(1.0))} )

the following prints out:

1.000000 1.000000

<correct answer>

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

7. Re: more lobbying

>    define short_name(x) very_long_function_name(x)

This wouldn't be useful for me, just more confusion with names.

> * Let us do stuff like this:
>    atom a = PI/180.0
>    sequence s1,s2
>    s1 = s2 = {"Plea",se.."}

This would be VERY useful and it would come very often to use.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu