[code] Need advice for snippet.

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Tue, 19 Jan 2016 21:44:12 +0800

I'm trying to make a snippet to give me some standardized format for Prolog
predicates. The snippet looks like this:

%%! %1(NAME)(%2(ARGUMENTS)) is %3{det,semidet,failure,nondet,multi}
%%
%% %4(DESCRIPTION)
%1(%2) :-
  %0

The problem is the second-to-last line. "%1(%2)" expands into just the
contents of "%2" and nothing else. "%1 (%2)" expands as expected, but this
is, unfortunately, a syntax error in Prolog. How would I go about getting
what I want such that if "%1" is "foo" and "%2" is "Bar" I'll generate
"foo(Bar) :-" in that second-to-last line?

-- 
"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 19 Jan 2016 - 08:44:12 EST

This archive was generated by hypermail 2.2.0 : Wed 20 Jan 2016 - 06:36:06 EST