sugar.cr
Sugar for Crystal
Some syntactic (and maybe API) sugar for Crystal programs.
Installation
-
Add the dependency to your project's
shard.yml
:dependencies: sugar: github: nogginly/sugar.cr
-
Run
shards install
Usage
Lazy variables
require 'sugar'
include Sugar
class Num(T)
def initialize(@value : T); end
lazy square : T { @value.abs2 }
lazy twice : T do
@value * 2
end
end
Contributing
Bug reports and sugestions are welcome, please raise an issue if you find a problem or have a question. Otherwise, for now, this project is closed for pull requests. I appreciate your understanding.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Contributors
- nogginly - creator and maintainer
Repository
sugar.cr
Owner
Statistic
- 1
- 0
- 0
- 0
- 0
- over 1 year ago
- December 22, 2023
License
Apache License 2.0
Links
Synced at
Mon, 24 Mar 2025 02:47:45 GMT
Languages