Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE implement '@', '++', '!' ,'--' (on the C level for meta_predicates/1) #18

Open
TeamSPoon opened this issue Apr 3, 2016 · 2 comments

Comments

@TeamSPoon
Copy link
Owner

See http://www.swi-prolog.org/pldoc/doc_for?object=section(2,%275%27,swi(%27/doc/packages/pldoc.html%27))

Currently all four bits are used up of the MA_INFO mask.. I am thinking about being lazy and using an 8 bit ASCII notation for storing the meta_predicate modes .. thus will be char* (instead)

@JanWielemaker
Copy link
Collaborator

Unsure. Paulo advocates that modes and meta-declarations should no co-exist in one description and only '*' should be used for non-meta-arguments. That makes a lot of sense to me. (Detailed) modes are anyway associated with determinism and sometimes types and thus, while each argument has a well defined meta-argument meaning, it does not have a well defined mode. The current situation is inherited from Quintus and also part of SICStus, Ciao and YAP (and possibly others).

@TeamSPoon
Copy link
Owner Author

On Sun, Apr 3, 2016 at 3:14 AM, Jan Wielemaker [email protected] wrote:
Unsure. Paulo advocates that modes and meta-declarations should no co-exist in one description and only '*' should be used for non-meta-arguments. That makes a lot of sense to me. (Detailed) modes are anyway associated with determinism and sometimes types and thus, while each argument has a well defined meta-argument meaning, it does not have a well defined mode.
​​

​I think this is very wise.. Since that deals with a situation like:

:-meta_predicate​(w_t_v(*,*,1,*,0)).

%% w_t_v(--VarIn:var, ++ReplaceAtom:atom, +WasGoal:callable, ?Arg:term, -NewGoal:callable) is det.
% 
% 

w_t_v(VarIn,ReplaceAtom,WasGoal,Arg,NewGoal):-
   subst(WasGoal,ReplaceAtom,VarIn,GoalMid),
  NewGoal = call(GoalMid,Arg).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants