Redux: a redo implementation in Go
github.com3 pointsby gyepi0 comments
# redo banana.x
redo invokes banana.x.do with the command: sh -x banana.x.do banana.x banana XXX > ZZZ
so banana.x.do is invoked with three arguments and its output is redirected to a file. $1 denotes the target file
$2 denotes the target file without its extension
$3 is a temp file: XXX, in this case.
banana.x.do is expected to either produce output in $3 or write to stdout, but not both. If there are no failures redo will chose the correct one, rename the output to banana.x and update the dependency database. redo-ifchange grape.y
to the banana.x.do, creating a dependency.
redo will rebuild grape.y (recursively) when necessary. CXX=g++
hello: main.o factorial.o hello.o
clean:
rm -rf *o hello
2. Shameless plug: he didn't mention redo [1], which is simpler than make and more reliable.
The comparable redo scripts to the Makefile would be: cat <<EOF > @all.do
redo hello
EOF
cat <<EOF > hello.do
o='main.o factorial.o hello.o'
redo-ifchange $o
g++ $o -o $3
EOF
cat <<EOF > default.o.do
redo-ifchange $2.cpp
g++ -c $1 -o $3
EOF
cat <<EOF > @clean.do
rm -rf *o hello
EOF
[Edit: Note that these are heredoc examples showing how to create the do scripts.] cat <<EOF | install -m 0755 /dev/stdin cc
#!/bin/sh
g++ -c "\$@"
EOF
# sed -i 's/^\(redo-ifchange.\+\)/\1 cc/' *.do
# sed -i 's}g++ -c}./cc}' *.do
sed calls could be combined; separated here for readablility. There was a child went forth every day;
And the first object he look’d upon, that object he became;
And that object became part of him for the day, or a certain part of the day, or for many years, or stretching cycles of years.
It's especially bad if you'd really rather be doing something other than what you're currently doing.
No, the radial arm saw does not get enough love because it is dangerous when used for anything but cross cuts and straight angled cuts, both of which are easily handled by a miter saw, which is safer and more versatile.
I used one for years and was happy when I finally gave it away. A sliding miter saw and a table saw are a safer combination, for sure.
Wholly agree with the dust collection. You can actually get far with a shop vac if you add a cyclone type pre-filter bin to it.