GithubHelp home page GithubHelp logo

pt_scripts's Introduction

Parse transform scripts

Build Status

Includes:

  • pt_lazy_case.erl - case unfolds from a tuple
  • pt_const_fun.erl - replaces the function with constant data on the results of their work
  • pt_build_info.erl - add get_info() returned git info for build project
  • pt_fabric.erl - parametrized modules
  • pt_fun_guards.erl - allow lists:member in guards test
  • pt_guard.erl - allow user function in guards test
  • pt_gen_proxy.erl - generated proxy modules
  • pt_macro.erl - add macro for func,args name and compile time regexp
  • pt_pmodule.erl - parametrized modules
  • pt_recompilable.erl - mutable modules
  • pt_records.erl - access to records field in compile time
  • pt_str_parser.erl - add string:match for easy regexp
  • pt_versioned.erl - add build_info function
  • pt_pp.erl

Usages:

For usage pt_script include needs header:

-include_lib("pt_scripts/include/pt_records.hrl").

Or add compile options:

-compile({parse_transform, pt_records}).

For work pt_lazy_case need to connect -include_lib("pt_scripts/include/pt_lazy_case.hrl") and to use macro ?lazy_case before the next type of structures

X = case {...} of ... end
or
case {...} of ... end

When using pt_lazy_case has the following limitations:

1) As the case is allowed only tuple
2) For variables, the Guard is not recommended, and for the tuple, is prohibited.
3) Matching also should be consistent, for example
    case {A1, A2} of
        {line, 'UserStr'} ->
            ok1;
        {message, 'UserStr'}  ->
            ok2;
        {message, 'UserStrLine'} ->
            ok3;
        {line, 'UserStrLine'} ->
            ok4;
        {_, 'UserStr'} ->
            ok5;
        {_, 'UserStrLine'} ->
            ok6;
        _ ->
            ok7
    end.
4) This module is not stable and requires the use only when tuple is composed of slow functions
(use at your own risk)

pt_scripts's People

Contributors

anton-ryabkov avatar gromobedg avatar platinumthinker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gromobedg

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.