Skip to content

Instantly share code, notes, and snippets.

@carlobaldassi
Created August 29, 2012 14:10
Show Gist options
  • Save carlobaldassi/3513128 to your computer and use it in GitHub Desktop.
Save carlobaldassi/3513128 to your computer and use it in GitHub Desktop.
TextWrap example
require("textwrap.jl")
import TextWrap.*
import OptionsMod.*
text = "Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library."
println("DEFAULT OPTIONS")
println("-"^70)
println_wrapped(text)
println("-"^70)
println()
println("WIDTH = 30, FIX_SENTENCE_ENDINGS = true")
println("-"^30)
println_wrapped(text, @options(width=>30, fix_sentence_endings=>true))
println("-"^30)
DEFAULT OPTIONS
----------------------------------------------------------------------
Julia is a high-level, high-performance dynamic programming language
for technical computing, with syntax that is familiar to users of
other technical computing environments. It provides a sophisticated
compiler, distributed parallel execution, numerical accuracy, and an
extensive mathematical function library.
----------------------------------------------------------------------
WIDTH = 30, FIX_SENTENCE_ENDINGS = true
------------------------------
Julia is a high-level, high-
performance dynamic
programming language for
technical computing, with
syntax that is familiar to
users of other technical
computing environments. It
provides a sophisticated
compiler, distributed parallel
execution, numerical accuracy,
and an extensive mathematical
function library.
------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment