Op zaterdag 19 jun 2010 11:16 CEST schreef Andy Wingo:
> On Fri 18 Jun 2010 22:50, Cecil Westerhof <[email protected]> writes:
>
>> Why is this so expensive?
>
> The general answer to this question can be found by profiling. You
> should factor your code into a function, then from the repl:
>
> ,profile (call-my-function)
>
> I wonder, perhaps we should have a --profile command-line flag...
When calling my script with:
dummy.scm "temp/input" "dummy.log" "^ +" "1234567890"
it is just executed.
When starting Guile, I give:
(load "bin/dummy.scm")
and then:
(main "temp/input" "dummy.log" "^ +" "1234567890")
and I get:
Backtrace:
In standard input:
10: 0* [main "temp/input" "dummy.log" "^ +" "1234567890"]
standard input:10:1: In procedure main in expression (main "temp/input"
"dummy.log" ...):
standard input:10:1: Wrong number of arguments to #<procedure main (args)>
ABORT: (wrong-number-of-args)
when I use:
(main ("temp/input" "dummy.log" "^ +" "1234567890"))
I get:
Backtrace:
In standard input:
11: 0* [main ...
11: 1* ["temp/input" "dummy.log" "^ +" "1234567890"]
standard input:11:7: In expression ("temp/input" "dummy.log" "^ +" ...):
standard input:11:7: Wrong type to apply: "temp/input"
ABORT: (misc-error)
So how should I call it from the REPL?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof