Skip to content

Instantly share code, notes, and snippets.

@JeffBezanson
Created June 27, 2014 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffBezanson/e95540b795a6457f1c63 to your computer and use it in GitHub Desktop.
Save JeffBezanson/e95540b795a6457f1c63 to your computer and use it in GitHub Desktop.
# as a string
"function check_new_version(existing::Vector{VersionNumber}, ver::VersionNumber)
@assert issorted(existing)
for v in [v\"0\", v\"0.0.1\", v\"0.1\", v\"1\"]
lowerbound(v) <= ver <= v && return
end
error(\"$ver is not a valid initial version (try 0.0.0, 0.0.1, 0.1 or 1.0)\")
end"
@tomasaschan
Copy link

I think you need a backslash on the $ before ver in the string interpolation as well - without it, I get an error stating "ver is not defined" when running parse on this =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment