[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
quirky inconsistency in stripping whitespace from function args?
From: |
Robert P. J. Day |
Subject: |
quirky inconsistency in stripping whitespace from function args? |
Date: |
Mon, 14 Feb 2005 09:03:42 -0500 (EST) |
in testing the treatment of whitespace in function calls in make
3.80, i've noticed that, in user-defined functions, all whitespace
(that is, both leading and trailing) appears to be preserved on all of
the arguments. thus, if i define a function and call it with
$(call myfunc, fred , barney)
^^ ^ ^^
the args that are passed are, respectively
" fred "
" barney"
but from page 64 of the 3rd edition of the o'reilly make book, when
discussing *built-in* functions, i read:
"Leading whitespace is trimmed from the first argument, but all
subsequent arguments include any leading (and, of course, embedded and
following) whitespace."
so the only difference in behaviour between user-defined and
built-in functions is the treatment of the leading whitespace of the
first argument? isn't this kind of a subtle inconsistency that might
trap the unwary? or am i reading this incorrectly?
rday
- quirky inconsistency in stripping whitespace from function args?,
Robert P. J. Day <=