Your wish is my command.  If you want to use sweet-expressions to write 
scripts, I have a new toy in the git repository, "sweet-run".  I'd like to know 
if it's worth keeping.

The "sweet-run" program processes the rest of the file through "unsweeten" and 
runs it.  Here's an example of using it, in this case to use scsh:

===================================
#!./sweet-run
;#!scsh -s
;!#

run cat("README")
===================================



Here's another example, to invoke guile:

===================================
#!./sweet-run
;#!guile
;!#

; This is a demonstration of sweet-run.
display "This calculates 5:\n"
display {2 + 3}
display "\n"

define factorial(n)
  if {n <= 1}
    1
    {n * factorial{n - 1}} ; f{...} => f({...})

display "Now let's calculate factorial(22):\n"
display factorial(22)


dwheeler@DWHEELER2-LT ~/readable-code
$ cat sweet-run-demo2
#!./sweet-run
;#!scsh -s
;!#
===================================


Thoughts?  Is it a keeper?

--- David A. Wheeler

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to