In Hylang Test.ipynb:
In [31]:
(defn optional-arg
[pos1 pos2 &optional keyword1 [keyword2 42]]
[pos1 pos2 keyword1 keyword2])
...
In [32]:
(setv args [1 2])
(setv kwargs {"keyword2" 3 "keyword1" 4})
(optional-arg args kwargs)
Out[32]:
[[1, 2], {'keyword2': 3, 'keyword1': 4}, None, 42]
Which is fine, but probably not what the user wants. Can we add an input after this that will show them how to properly unpack these arguments?
In [32]:
(setv args [1 2])
(setv kwargs {"keyword2" 3 "keyword1" 4})
(optional-arg (unpack-iterable args) (unpack-mapping kwargs))
Out[32]:
[1, 2, 4, 3]
I can make a pull request if you approve.
P.S. Thank you for this work. I threw this into a JupyterLab 3.0 notebook on something called myBinder.org 40 minutes ago and the experience has been ridiculously smooth and enjoyable. Cheers!
In Hylang Test.ipynb:
Which is fine, but probably not what the user wants. Can we add an input after this that will show them how to properly unpack these arguments?
I can make a pull request if you approve.
P.S. Thank you for this work. I threw this into a JupyterLab 3.0 notebook on something called myBinder.org 40 minutes ago and the experience has been ridiculously smooth and enjoyable. Cheers!