diff --git a/README.md b/README.md index a7aa035285634..a27b33a887081 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,20 @@ Currently, the `@compat` macro supports the following syntaxes: * `Base.Random.randmtzig_exprnd` is now `randexp` [#9144](https://github.com/JuliaLang/julia/pull/9144) +## New macros + +* `@inline` and `@noinline` have been added. On 0.3, these are "no-ops," meaning they don't actually do anything. + ## Other syntax changes * `Dict(ks, vs)` is now `Dict(zip(ks, vs))` [#8521](https://github.com/JuliaLang/julia/pull/8521) + +## Developer tips + +If you're adding additional compatibility code to this package, the following shell script is a useful for extracting the version number from a git commit SHA: + +```sh +#! /bin/bash +last_tag=$(git describe --tags --abbrev=0) +git rev-list $1 ^$last_tag | wc -l | sed -e 's/[^[:digit:]]//g' +``` diff --git a/src/Compat.jl b/src/Compat.jl index c4de0e2d5fc71..df526ea9eb471 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -101,6 +101,18 @@ function rewrite_split(ex, f) end end +if VERSION < v"0.4.0-dev+707" + macro inline(ex) + esc(ex) + end +end + +if VERSION < v"0.4.0-dev+2099" + macro noinline(ex) + esc(ex) + end +end + function _compat(ex::Expr) if ex.head == :call f = ex.args[1] @@ -118,6 +130,6 @@ macro compat(ex) esc(_compat(ex)) end -export @compat +export @compat, @inline, @noinline end # module