Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okeuday/record_info_runtime
Parse transform for using record_info(size, _) and record_info(fields, _) during runtime
https://github.com/okeuday/record_info_runtime
data-structures erlang
Last synced: about 2 months ago
JSON representation
Parse transform for using record_info(size, _) and record_info(fields, _) during runtime
- Host: GitHub
- URL: https://github.com/okeuday/record_info_runtime
- Owner: okeuday
- Created: 2013-09-12T04:58:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-03T20:49:27.000Z (almost 11 years ago)
- Last Synced: 2023-04-14T01:51:31.294Z (almost 2 years ago)
- Topics: data-structures, erlang
- Language: Erlang
- Homepage:
- Size: 195 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
`record_info_runtime` `Parse Transform`
=======================================Provides the functions:
record_info_size/1
record_info_fields/1Which are the runtime equivalent of:
record_info(size, _)
record_info(fields, _)The complete list of functions provided by the parse transform for
runtime usage with a variable storing the atom record name is below:* `records/0` - List of all record names defined
* `record_new/1` - Create a record with the defaults assigned
* `record_info_size/1` - Provide the record size (same as `erlang:tuple_size/1`)
* `record_info_fields/1` - Provide the record fields list (atom names for each record field)
* `record_info_fieldtypes/1` - Provide the record fields paired with their types in a list of tuplesUsing
-----Add this line to your module to use the `record_info_runtime` parse transform:
-compile([{parse_transform, record_info_runtime}]).
Build
-----rebar compile
Author
------Michael Truog (mjtruog [at] gmail (dot) com)
License
-------BSD