• Rob Pike's avatar
    new command gotry. · 570f59c1
    Rob Pike authored
    An exercise in reflection and an unusual tool.
    
    From the usage message:
    
    usage: gotry [packagedirectory] expression ...
    Given one expression, gotry attempts to evaluate that expression.
    Given multiple expressions, gotry treats them as a list of arguments
    and result values and attempts to find a function in the package
    that, given the first few expressions as arguments, evaluates to
    the remaining expressions as results.  If the first expression has
    methods, it will also search for applicable methods.
    
    If there are multiple expressions, a package directory must be
    specified. If there is a package argument, the expressions are
    evaluated in an environment that includes
    	import . "packagedirectory"
    
    Examples:
    	gotry 3+4
    		# evaluates to 7
    	gotry strings '"abc"' '"c"' 7-5
    		# finds strings.Index etc.
    	gotry regexp 'MustCompile("^[0-9]+")' '"12345"' true
    		# finds Regexp.MatchString
    
    R=rsc, PeterGo, r2
    CC=golang-dev
    https://golang.org/cl/2352043
    570f59c1
Name
Last commit
Last update
..
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
libcgo Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.ccmd Loading commit data...
Make.clib Loading commit data...
Make.cmd Loading commit data...
Make.common Loading commit data...
Make.inc Loading commit data...
Make.pkg Loading commit data...
all-arm.bash Loading commit data...
all-nacl.bash Loading commit data...
all.bash Loading commit data...
clean.bash Loading commit data...
env.bash Loading commit data...
make.bash Loading commit data...
quietgcc.bash Loading commit data...
run.bash Loading commit data...
sudo.bash Loading commit data...
version.bash Loading commit data...