* Re: help required w.r.t " vardef "
@ 2004-04-10 4:55 vinuth madinur
2004-04-13 9:01 ` Hans Hagen
0 siblings, 1 reply; 2+ messages in thread
From: vinuth madinur @ 2004-04-10 4:55 UTC (permalink / raw)
Thankx Hans,
But why does this work with "def" and not with "vardef" . "list" is just a macro name i've used.
And "A,B,C,A" is just the replacement text I want when I call the macro "list".
Is there any other way of doing this?
Vinuth.
--
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Re: help required w.r.t " vardef "
2004-04-10 4:55 help required w.r.t " vardef " vinuth madinur
@ 2004-04-13 9:01 ` Hans Hagen
0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2004-04-13 9:01 UTC (permalink / raw)
At 06:55 10/04/2004, you wrote:
>Thankx Hans,
>
>But why does this work with "def" and not with "vardef" . "list" is just a
>macro name i've used.
>
>And "A,B,C,A" is just the replacement text I want when I call the macro
>"list".
from the name vardef you can deduce that it acts like a var; see Jonathan
Nicholl's excellent explanation for more details,
in general a vardef is used in situations where you want to do a lot of
things and only get back teh result
n := 0 ;
def blabla (expr x) =
(1+x)
enddef ;
a := blabla(1) ; % a := (1+1)
def blabla (expr x) =
n := n + 1 ;
(1+x)
enddef ;
a := blabla(1) ; % fails, since now the expansion becomes visible: a := n
:= n+1 ; (1+x)
vardef blabla (expr x) =
n := n + 1 ;
(1+x)
enddef ;
a := blabla(1) ; % a := (1+1)
also, vardef has grouping built in
>Is there any other way of doing this?
not that i know of
Hans
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-13 9:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-10 4:55 help required w.r.t " vardef " vinuth madinur
2004-04-13 9:01 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).