[eclipse-clp-users] Macro expansion, C interface

From: \ luke2k4_at_...6... <luke2k4_at_...6...>
Date: Mon, 26 Jul 2010 03:01:58 +0200
 Exported from Notepad++
Hi Eclipse users,
I have a question about macro expansion, is there a way to make macro
expansion work while creating terms or calling a goal via the C interface ?
If I compile the code below and call the main/2 (like in the commented line)
through the TCL/Tk gui or command line it works fine,
but if I load the code by the C interface, construct the very same goal and
invoke it, the macro expansion does not get triggered.
Is there a way to make it work without explicit macro expansion or
explicitly calling update_struct/4?

Best regards
Luke

:-module(main). tr_structure(structure(StructName,FieldList),Struct):-
update_struct(StructName, FieldList, _Old, Struct), true. :- export macro(
structure/2, tr_structure/2, []). :- export struct(test_struct(field1,field2
)). %main(structure(test_struct, [field1 : 1, field2 : 2]), Out) main(
TestStruct,Field2):-
writeln(TestStruct),
TestStruct = test_struct{ field2:Field2 }.
Received on Mon Jul 26 2010 - 01:02:05 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST