Re: goto...
- Posted by Mark Brown <mabrown at SENET.COM.AU> Feb 11, 2002
- 728 views
Hi Karl, So, your Euphoria would be the PD core + your extras? This will be very frustrating if we get wothwhile features but can't bind or translate. I don't particularly need goto (although I fully support Kat's right to request it and then use it when/if she gets it) but there are things I would like such as the variable initialising and structures. I also would like to see an improved method for calling dll's even if the solution is just to wrap the method we use now in a tidier syntax. At the moment we do something like this.... atom aw_position aw_position = allocate(24) global function Morfit_engine_add_world( sequence world_file_name, sequence world_directory_path, sequence bitmaps_directory_path, sequence myposition) poke(aw_position, atom_to_float64(myposition[1])) poke(aw_position+8, atom_to_float64(myposition[2])) poke(aw_position+16, atom_to_float64(myposition[3])) return c_func(xMorfit_engine_add_world,{allocate_string(world_file_name), allocate_string(world_directory_path), allocate_string(bitmaps_directory_path), aw_position}) -- returns Handle end function which might be nicer as something like this???...... dll_function Morfit_engine_add_world(string &world_file_name, string &world_directory_path, string &bitmaps_directory_path, float64[24] &aw_position) The interpreter could then when it encounters "string" do an allocate_string() on the parameter internally? float64[24] in this case might actually be a 3 element sequence (in this case XYZ coordinates), so that Euphoria first does an allocation of 24 bytes of space and then pokes each value of the sequence into that space, additionally doing "atom_to_float64". Finally it passes the pointers to all of this to the dll when the actual function is called. My limited experience of using dll's in Euphoria is that once the functions are wrapped, they are often much easier to use than with other languages. Getting there, however can be torture. Mark ----- Original Message ----- From: <kbochert at ix.netcom.com> To: "EUforum" <EUforum at topica.com> Sent: Sunday, February 10, 2002 10:58 AM Subject: Re: goto... Hi Kat, you wrote on 2/9/02 3:41:20 PM: >Ditto, i agree 100%. The loops of "while", "if", and "goto" won't be used >in >every program for everything, but used when needed. Let me know when you >will be releasing it, Karl, and i'll borrow <sigh> some money to get the >official >release from Rob to put your code into. How will you be doing this? And >will >your code self install into the PD version? I hope you will be releasing a >direct replacement for eu.ex and eu.exw, and not something we must find a >compiler for an learn compiling tricks ourselves? > >Kat > As I understand it, you would not need to buy the RDS package. My Euphoria extensions can only have the capabilities of the PD version, plus the extensions I add, and is therefore free as far as RDS is concerned. RDS sells the Binding, Tracing, Translating and Profiling capabilities, and I do not know if they apply only to RDS Euphoria code, or work on extended programs as well. I am compiling the source code using LCC on Windows, to generate exw.exe. I assume that I can generate an ex.exe version fairly easily. I would then be in a position to distribute a windows or dos executeable along with some documentation, which I believe is legal under Rob's licence. Unix may take a little longer, unless someone is willing to get the modified source and compile it themselves. Speed: These modifications slow down Euphoria by an infinitesimal amount. Unfortunately, using LCC instead of Watcom for compilation slows the interpreter by about 20%. (Watcom is GOOD). Watcom is not currently available but I may switch to Borland (about 10% slower than Watcom). Getting the code to (appear to) work is only half the battle, but the thought that someone might actually buy it should spur my efforts. There may be errors above -- corrections are welcome. Karl Bochert