zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: "Daniel X. Pape" <dpape@canis.uiuc.edu>, zsh-workers@math.gatech.edu
Subject: Re: try(X) in exec.c ?
Date: Fri, 15 Jan 1999 17:03:49 -0800	[thread overview]
Message-ID: <990115170349.ZM28259@candle.brasslantern.com> (raw)
In-Reply-To: <Pine.GSO.4.05.9901151218500.3484-100000@sabine.canis.uiuc.edu>

On Jan 15, 12:21pm, Daniel X. Pape wrote:
} Subject: try(X) in exec.c ?
}
} I wanted to ask if someone could tell me what the purpose of the return
} value of the macro try(X) in exec. is? (In the zsh-3.1.5-pws-4 source)
} 
} As far as I can tell, the newly allocated string that try(X) returns is
} not assigned to anything at the four places in exec.c that it is used ...
} so that string never gets freed.

It's a macro.  A return statement in a macro doesn't return anything from
the macro, it returns it from the function that calls the macro.  So the
value is returned from findcmd(), and you have to look at the calls to
findcmd() to see whether the string gets freed.

I don't know who named the try() macro; it was a pretty awful choice, and
conventionally any macro that refers to its argument more than once should
be written in all upper case (to remind programmers not to call it with
autoincremented parameters).  Renaming try(X) to MAYBE_RETURN(X) or some
such might be a good idea.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1999-01-16  1:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-15 18:21 Daniel X. Pape
1999-01-16  1:03 ` Bart Schaefer [this message]
1999-01-18 13:09   ` PATCH: 3.1.5-pws-4: findcmd() Peter Stephenson
1999-01-18 16:43     ` Bart Schaefer

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=990115170349.ZM28259@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=dpape@canis.uiuc.edu \
    --cc=zsh-workers@math.gatech.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).