Skip to content

Conversation

@super7ramp
Copy link

Fixes babashka/babashka#1886.

Please answer the following questions and leave the below in as part of your PR.

(sci.impl.records/->record-impl '~rec-type ~rec-type (var ~record-name)
(sci.impl.records/->record-impl '~rec-type
~rec-type
(set (map keyword ~keys))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think creating the set of keywords doesn't need to happen at runtime in the constructor, but can happen at macro time, once, instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In fact, we already have this, kind of, it's called keys, it's already a vector of keywords so you can introduce another local there, called key-set by turning that into a set

Copy link
Collaborator

Choose a reason for hiding this comment

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

I pushed one minor simplification to the existing code: arg-syms and fields were basically already the same thing so there was some unnecessary code

Copy link
Collaborator

Choose a reason for hiding this comment

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

Tried to resolve the conflict manually git the Github UI. Hopefully didn't make any mistakes there :)

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.

dissoc on record returns same record type with missing field

2 participants