ndmitchell / build-shootout

Comparison of build program expressive power
87 stars 11 forks source link

Updated fabricate examples #14

Closed refi64 closed 10 years ago

refi64 commented 10 years ago

This pull request:

ndmitchell commented 10 years ago

Thanks, looks good - but I'm just off to bed so I'll review this properly tomorrow.

ndmitchell commented 10 years ago

Two things:

I suspect that means it isn't doing what the test calls for. Can you do that in Fabricate? I suspect not, as Fabricate targets have to be functions, and you can't have an infinite number of them.

ndmitchell commented 10 years ago

PS. I note you've contributed to Sake, and I'd welcome Sake patches for the build-shootout :)

refi64 commented 10 years ago
  1. It was by accident. I just ran git add *.py and forgot that I had put fabricate in the same directory.
  2. Ack! I'll fix that when I have access to a computer(on a phone right now).

I'll probably will add Sake examples; I had forgotten about that.

refi64 commented 10 years ago

I think I fixed the issues. Let me know if you find anything else.

refi64 commented 10 years ago

If you want, I can squash the commits.

ndmitchell commented 10 years ago

Sorry, I managed to miss the email with the fixes in. I'll review tonight once my son goes to sleep. No need to squash the commits, I'm not that fussy about the repo history. Thanks!

ndmitchell commented 10 years ago

Thanks, I've merged that all in. I would have expected the fabricate wildcard example to read more along the lines of:

for each f in args()
   globals()[base] = type(base, (object,), {'out': get_cp(f, base+'.out')})
main()

e.g. populate the targets based on the command line, not the presence of files it works for. However, the idea of filling in all the sensible targets works quite nicely, it's certainly in the ballpark - and is using fabricate in a new and interesting way, so arguably is worth including just for that. Nice.