Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gfldex/perl6-nonillist
Warn or fail when turning Nil into a list.
https://github.com/gfldex/perl6-nonillist
Last synced: 28 days ago
JSON representation
Warn or fail when turning Nil into a list.
- Host: GitHub
- URL: https://github.com/gfldex/perl6-nonillist
- Owner: gfldex
- License: artistic-2.0
- Created: 2019-05-11T21:14:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T20:07:06.000Z (over 4 years ago)
- Last Synced: 2024-11-06T05:44:08.980Z (3 months ago)
- Language: Raku
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NoNilList
[![Build Status](https://travis-ci.org/gfldex/perl6-nonillist.svg?branch=master)](https://travis-ci.org/gfldex/perl6-nonillist)
Warn or fail when turning Nil into a list.
## MOTIVATION
Nil can pop up in many places where one might not expect it. This is usually
fine. It can become problematic when it is turned into a list.```
sub niler { }my @a = niler();
say so @a.elems == 1; # True@a := niler.list;
say so @a.elems == 1; # Truefor niler() {
say 1; # 1
}
```Here we turn the absense of a value into a list with one element.
## USAGE
`use NoNilList::Fatal;`
This will die on `Nil.list`.
`use NoNilList::Warnings;`
This will warn and return `Empty` on `Nil.list`.
## 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.ⓒ2019 Wenzel P. P. Peppmeyer