Skip to content

rolkar/parse_trans_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests of Ulf Wigers parse_trans package

  1. Installation

  1. Parent child

The first test contains the two files parent.erl and child.erl.

The file parent.erl contains a function (foo/1) that is neither used nor exported. The transform (transform_parent.erl) simply exports that function.

The file child .erl calls foo/1 locally, even if it does not exist. This call is replaced by parent:foo/1. So - when running child:bar/0, then parent:foo/1 is called instead.

  1. Parent child 2

This is a similar example as the one above. But, instaed of manipulating the export and calls we actually inline code from the parent to the child. This means that the code for foo/1 is copied from parent to child.

  1. exprecs

The second test contains the two files recorder.erl and test_recorder.erl.

The first file implements a simple exprecs module, which automatically creates access functions to records.

The second file is a test for the functionality.

About

Examples to Ulf Wiger's parse_trans library for Erlang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages