From 6dda2b9279956f9421df6fe220ebc98a58ed8049 Mon Sep 17 00:00:00 2001 From: Leah Hanson Date: Tue, 19 Mar 2013 18:11:47 -0400 Subject: [PATCH] Changed the argument names to base to be more informative in the repl. Now, methods(base) will have more than single-letter variable names. I also modified the help documentation to mirror the variable name change. --- base/intfuncs.jl | 6 +++--- doc/helpdb.jl | 8 ++++---- doc/stdlib/base.rst | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index b3fd902c22bb6..f9c2b3c9e23e0 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -287,9 +287,9 @@ function _base(symbols::Array{Uint8}, b::Int, x::Unsigned, pad::Int, neg::Bool) ASCIIString(a) end -base(b::Integer , x::Integer, pad::Integer) = _base(dig_syms,int(b),unsigned(abs(x)),pad,x<0) -base(s::Array{Uint8}, x::Integer, pad::Integer) = _base(s,length(s),unsigned(abs(x)),pad,x<0) -base(b::Union(Integer,Array{Uint8}), x::Integer) = base(b, x, 1) +base(base::Integer, n::Integer, pad::Integer) = _base(dig_syms,int(base),unsigned(abs(n)),pad,n<0) +base(symbols::Array{Uint8}, n::Integer, p::Integer) = _base(symbols,length(symbols),unsigned(abs(n)),p,n<0) +base(base_or_symbols::Union(Integer,Array{Uint8}), n::Integer) = base(base_or_symbols, n, 1) for sym in (:bin, :oct, :dec, :hex) diff --git a/doc/helpdb.jl b/doc/helpdb.jl index b2fde64c019d1..a6b5974b1d0ad 100644 --- a/doc/helpdb.jl +++ b/doc/helpdb.jl @@ -2587,12 +2587,12 @@ "), -("Data Formats","Base","base","base(b, n[, pad]) +("Data Formats","Base","base","base(base, n[, pad]) Convert an integer to a string in the given base, optionally - specifying a number of digits to pad to. The base \"b\" can be - specified as either an integer, or as a \"Uint8\" array of - character values to use as digit symbols. + specifying a number of digits to pad to. The base can be specified + as either an integer, or as a \"Uint8\" array of character values + to use as digit symbols. "), diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index bfbb8b7f48fb9..2ff36b5829e76 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -1677,9 +1677,9 @@ Data Formats Convert an integer to an octal string, optionally specifying a number of digits to pad to. -.. function:: base(b, n, [pad]) +.. function:: base(base, n, [pad]) - Convert an integer to a string in the given base, optionally specifying a number of digits to pad to. The base ``b`` can be specified as either an integer, or as a ``Uint8`` array of character values to use as digit symbols. + Convert an integer to a string in the given base, optionally specifying a number of digits to pad to. The base can be specified as either an integer, or as a ``Uint8`` array of character values to use as digit symbols. .. function:: bits(n)