Skip to content

Conversation

timothymcmackin
Copy link
Contributor

I think these should be in a namespace/struct for clarity. In the case of jsligo it's necessary to know whether the @entry annotation should be in a comment or not.

@timothymcmackin timothymcmackin self-assigned this Jul 14, 2025
Comment on lines +2 to +3
type storage_type = int
type return_type = operation list * storage_type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing the type x_type thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually do that to distinguish types from values. Otherwise statements like storage: storage = ... can get confusing.

[], store + value

[@entry]
let increment (delta : int) (store : storage) : ret = [], store + delta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the previous names seems better overall, increment, decrement and delta vs add, sub and value.

@@ -1,15 +1,18 @@
type storage = int
module Counter = struct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why the module wrapper?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the JsLIGO example? I suppose it's not necessary here except that devs probably put most contracts in a module. If you think it's distracting I'll take it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants