From: Marc Chantreux <khatar@phear.org>
To: Justin M Wozniak <wozniak@mcs.anl.gov>
Cc: zsh-users@zsh.org
Subject: Re: real time alias?
Date: Fri, 16 Mar 2018 18:51:58 +0100 [thread overview]
Message-ID: <20180316175157.4ivasht4mv5ajv4t@prometheus.u-strasbg.fr> (raw)
In-Reply-To: <0d176b63-3e79-ddd3-dcfa-03bed94db0e2@mcs.anl.gov>
Hi Justin,
On Fri, Mar 16, 2018 at 12:19:03PM -0500, Justin M Wozniak wrote:
> Is there a way to have aliases work as macros?
the point i was trying to emphasize in my last mail is that
aliases really are macros (as preprocessor macros ...
not hygenic ones ...) that can be redefined
(from a user perspective: i rarely dove into the zsh code).
if you want to see that in action, `which` can help
alias foo='echo this is it'
bar () {
print hello
foo
}
alias foo=booog
which bar
outputs the content of the function where you can see that
* there is no more mention of 'foo'
* foo is substitued with the value of foo at the time the function was
defined
bar () {
print hello
echo this is it
}
is this what you asked for ?
> For example, can some
> modification of warn_ () be used to return from the calling function?
can you give an exemple of what you would like to get ?
hth
marc
next prev parent reply other threads:[~2018-03-16 17:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 17:51 Ray Andrews
2018-03-15 17:57 ` Jérémie Roquet
2018-03-15 18:13 ` Ray Andrews
2018-03-15 21:44 ` Marc Chantreux
2018-03-15 21:46 ` Marc Chantreux
2018-03-16 17:19 ` Justin M Wozniak
2018-03-16 17:41 ` Ray Andrews
2018-03-17 16:00 ` Marc Chantreux
2018-03-16 17:51 ` Marc Chantreux [this message]
2018-03-16 16:47 ` Ray Andrews
2018-03-16 17:41 ` Marc Chantreux
2018-03-16 18:13 ` Bart Schaefer
2018-03-16 18:56 ` Ray Andrews
2018-03-18 23:01 ` Bart Schaefer
2018-03-19 0:05 ` Ray Andrews
2018-03-17 23:17 ` Bart Schaefer
[not found] <98aa0638-97ed-dfe0-8dd2-39129d02c084__39937.2481661432$1521136270$gmane$org@eastlink.ca>
2018-03-17 22:47 ` Stephane Chazelas
2018-03-18 3:20 ` Ray Andrews
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=20180316175157.4ivasht4mv5ajv4t@prometheus.u-strasbg.fr \
--to=khatar@phear.org \
--cc=wozniak@mcs.anl.gov \
--cc=zsh-users@zsh.org \
/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).