[Shootout-list] Generic splitter for source code
Einar Karttunen
ekarttun@cs.helsinki.fi
Sat, 18 Jun 2005 09:42:53 +0300
Hello
Is someone working on this? I can create a simple splitter (in
e.g. perl) if nobody else wants to do it. Here is a simple spec -
do we need more?
1) calling convention:
+ splitter create <file-to-split>
2) syntax in files
+ ten '=' chars at the beginning of a line followed by
the name of the part (allow [A-Za-z0-9_\.]).
3) for each part in the file create the file for the part.
4) cleanup
+ splitter clean <file-to-split>
remove the files that would be created with create.
+ splitter list <file-to-split>
list the files that would be created with create.
Splitter can be safely run on files with no splits.
Should I submit this?
Short example:
foo.ghc
==========FooMeta.hs
metaAck :: Int -> Int -> Int
metaAck 0 n = n+1
metaAck m 0 = metaAck m 1
metaAck m n = metaAck (m-1) (metaAck m (n-1))
==========Foo.hs
import FooMeta
import System
main = do ~[num] <- getArgs
putStrLn ("Ack(3," ++ num ++ "): " ++ (show ($(metaAck 3) (read num))))
Things we will need in addition:
1) make loc ignore lines beginning with 10 '=' (optional)
2) some extra logic in the benchmarking script
- Einar Karttunen