3 ms·
Cool little walkthrough of a basic Guile program. Guile needs more tutorials and introductory material like this. To build on that example, it might be cool t
by davexunit 12y ago
Cool little walkthrough of a basic Guile program. Guile needs more tutorials and introductory material like this.
To build on that example, it might be cool to show off Guile's pattern matching capabilities when you are checking the list of program arguments:
(use-modules (ice-9 match))
(match (program-arguments)
((_) (display "Not enough arguments\n"))
((_ file-names ...) (for-each do-stuff file-names)))
The 'match' macro is one of the most useful things I have ever learned to use. No more car/cdr/cadadr/etc., just use match!
Edit: The title should be edited to say "(2012)", I think. I wasn't paying attention and thought this was a new blog post.
- soapdog 12y agooh! thanks for showing that macro! :D
- melling 12y agoGuile has been included as a scripting language in gimp for years. There should be lots of beginner material written for that. http://www.gimp.org/tutorials/Basic_Batch/ http://www.gimp.org/tutorials/Basic_Batch/
- gte525u 12y agoGimp currently uses TinyScheme and SIOD was the interpreter before that.
- davexunit 12y agoReally? That's a bummer. It's a GNU project, so it should be using Guile.
- zem 12y agoas far as i can tell, guile's windows support is still an afterthought, which limits its possible uses. it would definitely not to do have a posix-only scripting language as the default in gimp, for instance.