Giter VIP home page Giter VIP logo

compat.jl's Introduction

Compat Package for Julia

Build Status

The Compat package is designed to ease interoperability between older and newer versions of the Julia language. In particular, in cases where it is impossible to write code that works with both the latest Julia master branch and older Julia versions, or impossible to write code that doesn't generate a deprecation warning in some Julia version, the Compat package provides a macro that lets you use the latest syntax in a backwards-compatible way.

This is primarily intended for use by other Julia packages, where it is important to maintain cross-version compatibility.

Usage

To use Compat in your Julia package, add a line Compat to the REQUIRE file in your package directory. Then, in your package, after a using Compat statement to load Compat, simply use:

@compat ...Julia master syntax...

wherever you want to use syntax that differs in the latest Julia master (the development version of Julia).

Supported syntax

Currently, the @compat macro supports the following syntaxes:

  • @compat Dict(foo => bar, baz => qux) - type-inferred Dict construction.

  • @compat Dict{Foo,Bar}(foo => bar, baz => qux) - type-declared Dict construction.

  • @compat split(str, splitter; keywords...) - the Julia 0.4-style keyword-based split function

Type Aliases

  • typealias AbstractString String - String has been renamed to AbstractString #8872

compat.jl's People

Contributors

garborg avatar ivarne avatar jakebolewski avatar jfsantos avatar rfourquet avatar simonster avatar stefankarpinski avatar stevengj avatar timholy avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.