On 2013-7-24 00:47 , Mojca Miklavec wrote:
> After seeing all the different semi-confusing options I noticed
> something really simple. While this fails:
>
> foreach {foo.version foo.string} ${foo.versions} {
> subport foo-${foo.version} {
> pre-fetch {
> system "echo ${foo.version}"
> }
> }
> }
>
> the following works just fine:
>
> foreach {foo.version foo.string} ${foo.versions} {
> subport foo-${foo.version} {
> set foo.versionx ${foo.version}
> pre-fetch {
> system "echo ${foo.versionx}"
> }
> }
> }
>
> I believe that this is more readable and easier to understand than the
> map/eval trickery.
Yes, using variables in a procedure rather than splicing their values
into the procedure's definition is generally good practice. :-)
- Josh
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev