Closed ghost closed 3 years ago
Alright it is quite a lot to take in... I should release some sample project really to show some real-world usage. I am actually working on a small web-based knowledge base API in min, but it's not quite ready yet to be open sourced.
So... right, I'll explain here then update the docs as well.
When you define your operator signature, the output values are actually already bound to null
. The problem is that you are going to get an error if you don't re-bind them unless you specify a type signature which allows a nullable value, like this:
(
symbol get-or-null
(quot :list i :item ==> a|null :result)
(
(list i in?)
(i @result)
(return)
if
)
) ::
Void returning? Just don't put anything after ==>
in the signature:
(
symbol echo
(a :item ==>)
(item puts)
) ::
Extra thanks 😄 for examples about operator
defining. Now...:
operator
defining?This is going to be a Parchment of Questions 💯 (Making a lang like a real lang is not so easy, that i mean. i may be successful at.)
Improved docs in v0.29.0
I cannot use
operator
constructing in min files. Because its behavior is so confusing. May you give more info about operators? For example void returning?