From dfa1fc0ed5771d11e870ef9699f492a73e0500ad Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Thu, 7 Dec 2023 21:59:35 +0000 Subject: [PATCH] move {#} to prelude.tcl --- day07/sol.tcl | 3 +-- prelude.tcl | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/day07/sol.tcl b/day07/sol.tcl index 3b27e94..f501c97 100755 --- a/day07/sol.tcl +++ b/day07/sol.tcl @@ -1,6 +1,5 @@ #!/usr/bin/env tclsh -#source ../prelude.tcl -proc {#} args {} +source ../prelude.tcl proc parse input { return [join [split [read $input] "\n"]] diff --git a/prelude.tcl b/prelude.tcl index 19e91c1..d7d7389 100644 --- a/prelude.tcl +++ b/prelude.tcl @@ -2,6 +2,8 @@ package require Tcl 8.6 namespace import tcl::mathfunc::min namespace import tcl::mathfunc::max +proc {#} args {} + proc ladd {list} { set t 0 foreach x $list { incr t $x }