[Omake] $" " inside of a lazy expansion $`( ) still expands $()
Jason Hickey
jyh at cs.caltech.edu
Tue Sep 12 18:43:36 PDT 2006
Hi David,
Sorry about the delay, I've been traveling.
I just noticed this too. It definitely looks like a bug. I'll take a
look and see what I can find.
Jason
David Cooke wrote:
> Hi,
>
> I came across this trying to figure out why OCAMLPACKS wasn't working
> (this is with the 0.9.8.x branch in svn). Variables $() inside of
> omake quotes $" " inside of a lazy expansion $`() are expanded at
> definition time, not lazily.
>
> Here's a transcript from osh to show the problem:
>
> % FILES[] = a b c
> - : <array
> "a" : Sequence
> "b" : Sequence
> "c" : Sequence>
> : Array
> % SUF = .c
> - : ".c" : Sequence
> % X = $`(addsuffix $(SUF), $(FILES))
> - : $(apply global.addsuffix $(apply global.SUF) $(apply global.FILES))
> % echo($X)
> a.c b.c c.c
> % # add a omake quotation with $" "
> % X = $`(addsuffix $"$(SUF)", $(FILES))
> - : $(apply global.addsuffix <data ".c"> : String $(apply global.FILES))
> % # uh oh, that doesn't look good. And it isn't...
> % SUF = .x
> - : ".x" : Sequence
> % echo($X)
> a.c b.c c.c
>
> In the second assignment to X, I use $"$(SUF)", which ends up getting
> expanded at definition time, not lazily as the $`() should make it.
>
> PREFIXED_OCAMLPACKS uses this construct, so assigning to OCAMLPACKS
> afterwards doesn't do anything. I've fixed this in my version by just
> removing the quotes in PREFIXED_OCAMLPACKS (since commas are used as
> the separators).
>
> --
> David M. Cooke
> david.m.cooke at gmail.com
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
--
Jason Hickey http://www.cs.caltech.edu/~jyh
Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257
More information about the Omake
mailing list