[Omake] P.S.
Benjamin Pierce
bcpierce at cis.upenn.edu
Mon Jun 12 07:49:40 PDT 2006
Actually, this raises a small syntactic point...
Since
FOO =
bar
baz
is a syntactic error anyway, why don't you interpret it as
FOO = \
bar \
baz
and save all the silly backslashes?
- Benjamin
On Jun 10, 2006, at 2:49 PM, Aleksey Nogin wrote:
> On 10.06.2006 07:02, Benjamin Pierce wrote:
>
>> For completeness, here is the definition of COMMON_SOURCES...
> [...]
>> UBASE_LIB_SOURCES = safelist.ml uprintf.ml util.ml uarg.ml
>> prefs.ml trace.ml
> [...]
>> COMMON_SOURCES = \
>> $(foreach $(file), \
>> $(addprefix $(TOOLSDIR)/, $(SRC2FCL_SOURCES)) \
>> $(addprefix $(SRCDIR)/ubase/, $(UBASE_LIB_SOURCES)) \
>> $(addprefix $(SRCDIR)/, $(BASE_SOURCES)) \
>> $(addprefix $(LENSESDIR)/, $(NATIVE_LENS_SOURCES)) \
>> $(addprefix $(SRCDIR)/, $(TOPLEVEL_SOURCES)))
>
> Minor stylistic comments:
>
> In this case it probably does not matter, but normally we would
> make all these variables be arrays, using either the
>
> UBASE_LIB_SOURCES[] = safelist.ml uprintf.ml ...
>
> syntax or even
>
> UBASE_LIB_SOURCES[] =
> safelist.ml
> uprintf.ml
> ...
>
> The second format, although occupies more screen space, has two
> potential advantages:
> - In a versioning system, "svn annotate"/"cvs annotate"/etc would
> tell you when a file was added to the list.
> - It makes it possible to have file names with white space in them:
>
> UBASE_LIB_SOURCES[] =
> safelist.ml
> lib with a space.ml
> ...
>
> Also, most of the omake's functions would map sequences/arrays into
> arrays, so you should be able to simply use $(file ...) in place
> of $(foreach $(file), ...).
>
> For example, in osh:
>
> % cd /tmp/
> % foo=$(file bar baz)
> - : <array
> /tmp/bar : File
> /tmp/baz : File>
> : Array
>
> --
> Aleksey Nogin
>
> Home Page: http://nogin.org/
> E-Mail: nogin at cs.caltech.edu (office), aleksey at nogin.org (personal)
> Office: Moore 04, tel: (626) 395-2200
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
More information about the Omake
mailing list