Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gfldex/raku-operator-dynvaror
https://github.com/gfldex/raku-operator-dynvaror
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gfldex/raku-operator-dynvaror
- Owner: gfldex
- License: artistic-2.0
- Created: 2020-10-04T13:45:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-04T15:07:49.000Z (over 4 years ago)
- Last Synced: 2024-11-06T05:44:06.353Z (2 months ago)
- Language: Raku
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Operator::DynvarOr
[![Build Status](https://travis-ci.org/gfldex/raku-operator-dynvaror.svg?branch=master)](https://travis-ci.org/gfldex/raku-operator-dynvaror)
## SYNOPSIS
```
use Operator::DynvarOr;sub s {
my $*dynvar //* 42;
}s;
```This module supplies the infix operator `//*` that expects its LHS to be a
dynvar and its RHS a value. It scans the call stack for a dynvar of the same
name and sets the LHS to its value. If the dynvar is not declared in any
caller it will assign the RHS to the LHS. This allows optional dynvars to
contain undefined values which is otherwise difficult to achieve.## LICENSE
All files (unless noted otherwise) can be used, modified and redistributed
under the terms of the Artistic License Version 2. Examples (in the
documentation, in tests or distributed as separate files) can be considered
public domain.ⓒ2020 Wenzel P. P. Peppmeyer