1. Euphoria 3.2

There appear to be a few people stll using pre-V4 Euphoria and some using both 3.1 and 4.0. How about a Euphoria version 3.2 whose only enhancement is an ifdef structure?

That would allow for libraries that work on both 3.2 and 4.0 or that use global on 3.2 and public on 4.0.

I am joking really because I gave up using v3.1 ages ago.

Arthur

new topic     » topic index » view message » categorize

2. Re: Euphoria 3.2

ArthurCrump said...

There appear to be a few people stll using pre-V4 Euphoria and some using both 3.1 and 4.0. How about a Euphoria version 3.2 whose only enhancement is an ifdef structure?

That would allow for libraries that work on both 3.2 and 4.0 or that use global on 3.2 and public on 4.0.

I am joking really because I gave up using v3.1 ages ago.

There is nothing, really, stopping anyone from doing just this.

Matt

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

3. Re: Euphoria 3.2

mattlewis said...
ArthurCrump said...

There appear to be a few people stll using pre-V4 Euphoria and some using both 3.1 and 4.0. How about a Euphoria version 3.2 whose only enhancement is an ifdef structure?

That would allow for libraries that work on both 3.2 and 4.0 or that use global on 3.2 and public on 4.0.

I am joking really because I gave up using v3.1 ages ago.

There is nothing, really, stopping anyone from doing just this.

Matt

I have been working on ver 3 trying to add features. 
But I can not get anyone to tell me how to use call_func() from "C" code . 
I can not use callback because of DOS . 

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

4. Re: Euphoria 3.2

BRyan said...
mattlewis said...
ArthurCrump said...

There appear to be a few people stll using pre-V4 Euphoria and some using both 3.1 and 4.0. How about a Euphoria version 3.2 whose only enhancement is an ifdef structure?

That would allow for libraries that work on both 3.2 and 4.0 or that use global on 3.2 and public on 4.0.

I am joking really because I gave up using v3.1 ages ago.

There is nothing, really, stopping anyone from doing just this.

Matt

I have been working on ver 3 trying to add features. 
But I can not get anyone to tell me how to use call_func() from "C" code . 
I can not use callback because of DOS . 

There is no need to use call_func() from C code, or use callbacks, to add the ifdef functionality on 3.1.1, as that's all in the parser (which is part of the front end), not the backend.

Have you tried backporting the fix in the 4.0 DOS branch for DOS32 call_backs to 3.1.1? That will probably be a lot easier than trying to use call_func() to call Euphoria code from C code.

http://rapideuphoria.svn.sourceforge.net/viewvc/rapideuphoria/dos/trunk/source/be_callc.c?r1=4515&r2=4514&pathrev=4515

(Note that there's a HUGE difference between trying to call front-end translated C code from the backend (eucoverage takes advantage of this) and trying to call user written Euphoria code from either the front end or the backend.)

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

5. Re: Euphoria 3.2

BRyan said...

I have been working on ver 3 trying to add features. But I can not get anyone to tell me how to use call_func() from "C" code . I can not use callback because of DOS .

Assuming that you want the backend of your interpreter to call some code in your translated front end, I think the best way (as Jim mentioned) is to use the same technique that 4.1 uses.

Basically, when backend.e calls the machine_func that hands control over to the back end, you pass a routine id. Note that this will be a valid routine id for your translated front end, NOT the user's program. Then, using the routine list that the translator creates, you can get a pointer to the correct translated function and call that from you backend C code.

Here's what the call looks like currently:

	machine_proc(65,  
		{ 
			st,  
			sl,  
			ms,  
			lit,  
			include_info,  
			get_switches(),  
			Argv, 
			routine_id( "cover_line" ), 
			routine_id( "cover_routine" ), 
			routine_id( "write_coverage_db" ), 
			routine_id( "DisplayColorLine" ), 
			external_debugger_ptr, 
			routine_id( "map:new" ), 
			routine_id( "map:put" ), 
			routine_id( "map:get" ), 
			trace_lines, 
			$ 
		}) 

In start_backend(), we then do:

 
	map_new = get_pos_int(w, *(x_ptr->base+13)); 
	map_put = get_pos_int(w, *(x_ptr->base+14)); 
	map_get = get_pos_int(w, *(x_ptr->base+15)); 

In be_execute.c:

 
// routine ids to euphoria std/map routines: 
int map_new; 
int map_put; 
int map_get; 
 
/** 

 * Call's the front end's map:new() function 
 */ 
object call_map_new(){ 
	return internal_general_call_back( map_new, 690, 0, 0, 0, 0, 0, 0, 0, 0 ); 
} 
 
/** 

 * Calls the front end's map:put procedure 
 */ 
void call_map_put( object map, object key, object value, object operation ){ 
	RefDS( map ); 
	Ref( key ); 
	Ref( value ); 
	internal_general_call_back( map_put, map, key, value, operation, 23 /* default threshold */, 0, 0, 0, 0 ); 
} 
 
/** 

 * Calls the front end's map:get function 
 */ 
object call_map_get( object map, object key, object default_value ){ 
	RefDS( map ); 
	Ref( key ); 
	Ref( default_value ); 
	return internal_general_call_back( map_get, map, key, default_value, 0, 0, 0, 0, 0, 0 ); 
} 

These are the functions that wrap the actual call to the translated front end routines. I'm not sure if the syntax, names, etc, is exactly the same as for 3.1 code, but you can look at some translated code that uses call_func() to see an example.

Matt

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

6. Re: Euphoria 3.2

Thanks Everyone ! 
I will study the code and try that. 
Bernie 

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

Search



Quick Links

User menu

Not signed in.

Misc Menu