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

Require deeply-frozen defaults #282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joeldrapper
Copy link
Owner

No description provided.

@joeldrapper joeldrapper marked this pull request as ready for review February 3, 2025 17:32
@joeldrapper
Copy link
Owner Author

I'm not sure if this is the ideal behaviour. I think an object being shallow-frozen may be a sufficient indication that you want to use this exact object.

@stephannv
Copy link
Contributor

stephannv commented Feb 3, 2025

I'm not sure if this is the ideal behaviour. I think an object being shallow-frozen may be a sufficient indication that you want to use this exact object.

I think they have slightly differences too, eg.:

class StripeProcessor
end

class PaymentProcessor
  extend Literal::Properties
  
  prop :processor, Class, default: StripeProcessor # this will fail because StripeProcessor.frozen? == false
end

StripeProcessor.frozen? # => false
Ractor.shareable? StripeProcessor # => true

@joeldrapper
Copy link
Owner Author

joeldrapper commented Feb 3, 2025

Good point. In this case, I feel like the Ractor.shareable? behaviour is better than frozen? since if you pass a class in, you clearly want it to be that specific instance of the Class class.

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