Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#537596: regression: parse error near `()' in function definition



Mikael Magnusson wrote:
> Just thought I'd mention you can also use \ at any time to escape an alias:

Something like that is worth mentioning.

Index: Etc/FAQ.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Etc/FAQ.yo,v
retrieving revision 1.47
diff -u -r1.47 FAQ.yo
--- Etc/FAQ.yo	21 Apr 2009 09:33:37 -0000	1.47
+++ Etc/FAQ.yo	20 Jul 2009 08:50:23 -0000
@@ -819,6 +819,14 @@
   use in the body of a function, but define the function first if the
   alias has the same name as the function.
 
+  If you aware of the problem, you can always escape part or all of the
+  name of the function:
+  verb(
+     'l'() { /bin/ls -la "$@" | more }
+  )
+  Adding the quotes has no effect on the function definition, but
+  suppresses alias expansion for the function name.  Hence this is
+  guaranteed to be safe.
 
 sect(Similarities with tcsh)
 

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


'member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom'



Messages sorted by: Reverse Date, Date, Thread, Author