Skip to content
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

defmutable-rules: identifier-rules variant of defmutable #1220

Merged
merged 9 commits into from
Apr 20, 2024
Merged

Conversation

vyzo
Copy link
Collaborator

@vyzo vyzo commented Apr 14, 2024

We can't use it in the runtime due to the public exports, but it is probably more of what you want in userland.

@vyzo vyzo requested a review from fare April 14, 2024 07:53
Copy link

netlify bot commented Apr 14, 2024

Deploy Preview for elastic-ritchie-8f47f9 ready!

Name Link
🔨 Latest commit b5822a4
🔍 Latest deploy log https://app.netlify.com/sites/elastic-ritchie-8f47f9/deploys/6623ddac0fc5c50008600aa9
😎 Deploy Preview https://deploy-preview-1220--elastic-ritchie-8f47f9.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vyzo vyzo mentioned this pull request Apr 14, 2024
@vyzo vyzo requested a review from a team April 14, 2024 11:30
Copy link
Collaborator

@fare fare left a comment

Choose a reason for hiding this comment

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

  1. Shouldn't we rename defmutable-rules to defmutable and be done?
  2. All the use sites of "defmutable" assume the old API which I suspect is the API of defmutable-rules and NOT that of the current defmutable
  3. If the problem is telling the type inferencer about the out-of-module set! --- why not add a new kind of annotation just for that, instead of doing weird things in identifier-rules?

@vyzo
Copy link
Collaborator Author

vyzo commented Apr 15, 2024

  1. We can call defmutable-rules as the main macro, defmutable and the other one defmutable*.
  2. We'll need to change it for the runtime mutables, as it is problematic for public exports (the runtime can't export macros through the prelude).
  3. It is not that simple, the compiler needs to know it is out of module and then apply different rules... Not exactly ideal.

@vyzo vyzo linked an issue Apr 18, 2024 that may be closed by this pull request
@vyzo
Copy link
Collaborator Author

vyzo commented Apr 18, 2024

Updated, as discussed.

@vyzo vyzo force-pushed the defmutable-rules branch from 33b7443 to 1ae8cf7 Compare April 18, 2024 15:14
@@ -13,7 +13,7 @@ namespace: #f
[["Gerbil" :: (gerbil-version-string)]
["Gambit" :: (system-version-string)]])

(defmutable build-manifest gerbil-system-manifest : :list)
(defmutable* build-manifest gerbil-system-manifest : :list)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why use defmutable* rather than defmutable?

And if so, you must update std/cli/multicall.ss (as found with git grep build-manifest).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we cannot export macros from the runtime through the prelude interface, as I have explained to you.

@@ -45,7 +45,7 @@ namespace: #f
=> :string
(build-manifest-string gerbil-system-manifest))

(defmutable gerbil-greeting (gerbil-system-version-string) : :string)
(defmutable* gerbil-greeting (gerbil-system-version-string) : :string)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question.

Need to update gerbil/boot-gxi.c, gerbil/interactive/init.ss.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same reply.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You still need to update gerbil/boot-gxi.c

@fare
Copy link
Collaborator

fare commented Apr 19, 2024

OK, but then you need to update the places that use the variables that used to be defmutable and are now defmutable*

@vyzo
Copy link
Collaborator Author

vyzo commented Apr 19, 2024

done.

@vyzo vyzo requested a review from fare April 19, 2024 06:16
@vyzo
Copy link
Collaborator Author

vyzo commented Apr 20, 2024

done.

@vyzo vyzo enabled auto-merge (squash) April 20, 2024 15:22
@vyzo vyzo merged commit 43be282 into master Apr 20, 2024
12 checks passed
@vyzo vyzo deleted the defmutable-rules branch April 20, 2024 15:53
vyzo added a commit that referenced this pull request Apr 20, 2024
Let's have types there too. Also improves match code generation a tad.

On top of #1220
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