1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#!/bin/sh
# Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons
# GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)
#
# A shell script to be called from vim, to automatically refactor a code
# fragment.
#
# Select the expression you want to refactor, on a line of its own, and
# in vim, type:
# !!pl
#
# (Assuming your lambdabot is installed in $HOME/lambdabot, it will
# replace the expression with the pointfree version
#
DECL=`cat`
cd $HOME/lambdabot/
echo "pl $DECL" | ./lambdabot 2> /dev/null | sed '$d;/Irc/d;s/lambdabot> //'
|