Re: implications, flames, etc.

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

Mark Brown wrote:

>This is what I have been doing (following stuff I've learned from you guys
>(and Todd Riggins) actually!). I guess what I mean is that I would like to
>turn the following (for example) :-
>
>atom view_direction,p1,p2,p3
>view_direction = allocate(3*8)
>p1 = allocate(3*8)
>p2 = allocate(3*8)
>p3 = allocate(3*8)
>--
>global function Morfit_math_is_clockwise_from_direction(sequence
>my_view_direction, sequence my_p1, sequence my_p2, sequence my_p3)
>
>    -- rip the values from the sequence(s) and poke them into the array(s)
>    poke(view_direction,    atom_to_float64(my_view_direction[1]))
>    poke(view_direction+8,  atom_to_float64(my_view_direction[2]))
>    poke(view_direction+16, atom_to_float64(my_view_direction[3]))
>    --
>    poke(p1,    atom_to_float64(my_p1[1]))
>    poke(p1+8,  atom_to_float64(my_p1[2]))
>    poke(p1+16, atom_to_float64(my_p1[3]))
>    --
>    poke(p2,    atom_to_float64(my_p2[1]))
>    poke(p2+8,  atom_to_float64(my_p2[2]))
>    poke(p2+16, atom_to_float64(my_p2[3]))
>    --
>    poke(p3,    atom_to_float64(my_p3[1]))
>    poke(p3+8,  atom_to_float64(my_p3[2]))
>    poke(p3+16, atom_to_float64(my_p3[3]))
>
>    return c_func(xMorfit_math_is_clockwise_from_direction,{view_direction,
>p1, p2, p3})
>end function
>
>into something more like :-
>
>
>    ret_val = c_func(Morfit_math_is_clockwise_from_direction,{&
>view_direction, &p1, &p2, &p3)
>
>where &view_direction etc.... are just the location in memory of my
>sequence(s). This would mean I wouldn't have to poke into memory, everything
>I've just put into my sequence(s) so that the c function I'm calling knows
>where to get what it needs (and often I've found, where it needs to return
>stuff, which results in a whole new round of grabing the values from the
>memory locations and putting them in my sequences.
>
>I suppose we can just deal with the memory without loading and unloading the
>sequences but it seems to me to make doing anything else with the data a bit
>of a chore.
>
>The "atom_to_float" thing in the above also makes me wonder whether, just
>for using stuff in the C world etc, it might be a good idea to have fixed
>length types available in Euphoria (such as Double). From the flexible to
>the totally inflexible!. I think Rob is going to hate me for that one.
>Perhaps, something like :-
>
>sequence p1[3*8]
>
>I'm well out of my depth here so if any of this is junk, please just chuckle
>and go on.
>
>Mark.

Out of the mouths of babes...hey emperor, I really like those new clothes
you have there. Better said than I ever could. I realize that several of the
resident geniuses will come up with a dozen techniques to mask what you
have written, but the reality is that underneath it all is that loveliness that
you document so well...peek and poke.

Everett L.(Rett) Williams
rett at gvtc.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu