Skip to content

Commit

Permalink
Merge pull request #26 from JuliaLang/teh/inline
Browse files Browse the repository at this point in the history
Add stub inline and noinline macros
  • Loading branch information
timholy committed Dec 17, 2014
2 parents 18b5673 + b028f8a commit 4eda591
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```
14 changes: 13 additions & 1 deletion src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -118,6 +130,6 @@ macro compat(ex)
esc(_compat(ex))
end

export @compat
export @compat, @inline, @noinline

end # module

0 comments on commit 4eda591

Please sign in to comment.