ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Re: help required w.r.t " vardef "
Date: Tue, 13 Apr 2004 11:01:50 +0200	[thread overview]
Message-ID: <6.0.1.1.2.20040413105637.01df33c0@server-1> (raw)
In-Reply-To: <20040410045538.8E12739834A@ws5-1.us4.outblaze.com>

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  

      reply	other threads:[~2004-04-13  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-10  4:55 vinuth madinur
2004-04-13  9:01 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6.0.1.1.2.20040413105637.01df33c0@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).