-
Notifications
You must be signed in to change notification settings - Fork 502
Docs for casing on constants #7481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
The doc seems useful! I propose to add Plinth examples to accompany UPLC examples, as this user guide is for Plinth and it makes sense to showcase its types/expressions too. |
zliu41
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our convention for docs is to put each sentence on one line. No need to update this one but please keep it in mind in the future.
| ## Compiling to `case` in Plinth | ||
|
|
||
| When compiling Plinth code with the [option](./plinth-compiler-options) | ||
| `datatypes=BuiltinCasing`, many standard library functions will be compiled into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mention that this option is going away post hard fork (see the comment on the DatatypeStyle data type). Also please make an issue to update this post hard fork.
|
|
||
| ::: | ||
|
|
||
| In UPLC, it is possible to branch on expressions of certain built-in types, like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mention other ways of deconstructing builtin types (e.g., for bool one can use ifThenElse), and why using the new builtin casing feature is better.
| lam x (case x (lam a (lam b [(builtin addInteger) a b]))) | ||
| ``` | ||
|
|
||
| ### Integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention that the datatypes=BuiltinCasing optoin is irrelevant to Integer. To take advantage of casing on integer, in Plinth one must use PlutusTx.Builtins.caseInteger.
No description provided.