[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: aesthetics of variable references and function calls
From: |
Boris Kolpackov |
Subject: |
Re: aesthetics of variable references and function calls |
Date: |
Wed, 9 Jun 2004 16:33:17 +0000 (UTC) |
User-agent: |
nn/6.6.5+RFC1522 |
"Robert P. J. Day" <address@hidden> writes:
> i'm curious about what other folks use,
I use `()' in both function calls and variable references. I use `-'
to separate words in function names (e.g., foo-bar) and `_' to
separate words in variable names (e.g., foo_bar). So the usage
would look like this:
a := $(call foo-bar,a,b)
b := $(foo_bar)
If you want some syntactic distinction for function calls you may
want to consider using `call' even for built-in functions:
c := $(call dir,a/b/c)
Here are some more rules I use:
@@ write "t: p" instead of "t : p" or "t :p"
@@ write $(call f,a) instead of $(call f, a) or $(call f , a)
@@ Use '-' to separate words in function names (e.g. foo-bar);
use 'define' to define functions.
@@ Use '_' to separate words in variable names (e.g. foo_bar);
use := to assign value to a variable. Use '=' if you know
what you are doing.
@@ Be careful with += in target-specific variables.
@@ Action explicitly requested by the user (which should correspond
to verbs, e.g. install, clean, configure) should perform without
regards to up-to-dateness.
hth,
-boris