Skip to content

Adding del() to remove map entries (e.g del(x[y])) or variables; optimize small map Set #302

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

Merged
merged 8 commits into from
Apr 6, 2025

Conversation

ldemailly
Copy link
Member

@ldemailly ldemailly commented Apr 6, 2025

Fixes #291 (and more)

  • delete of map[x]
  • delete as map.x
  • delete x

@ldemailly ldemailly changed the title Adding del() to remove map entries (e.g del(x[y])) or variables Adding del() to remove map entries (e.g del(x[y])) or variables; optimize small map Set Apr 6, 2025
@ldemailly ldemailly requested a review from Copilot April 6, 2025 02:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

eval/eval.go:441

  • [nitpick] Consider providing a clearer and more descriptive error message for the DOT case in delete, or implement the expected behavior instead of using a TODO message.
return s.NewError("TODO remove map dot:" + index.Inspect())

token/type_string.go:88

  • [nitpick] Verify that the updated _Type_name constant and index mapping correctly reflect the intended token order, ensuring the DEL token is appropriately positioned relative to others.
const _Type_name = "ILLEGALEOLstartValueTokensIDENTINTFLOATSTRINGLINECOMMENTBLOCKCOMMENTREGISTERendValueTokensstartSingleCharTokensASSIGNPLUSMINUSBANGASTERISKSLASHPERCENTLTGTBITANDBITORBITXORBITNOTCOMMASEMICOLONLPARENRPARENLBRACERBRACELBRACKETRBRACKETCOLONDOTendSingleCharTokensstartMultiCharTokensLTEQGTEQEQNOTEQINCRDECRDOTDOTORANDLEFTSHIFTRIGHTSHIFTLAMBDADEFINEendMultiCharTokensstartIdentityTokensFUNCTRUEFALSEIFELSERETURNFORBREAKCONTINUEMACROQUOTEUNQUOTELENFIRSTRESTPRINTPRINTLNLOGERRORCATCHDELendIdentityTokensEOF"

object/object.go:379

  • [nitpick] Review the transition code in SmallMap Set: confirm that using m.smallKV[i:m.len-1] correctly captures all elements after the insertion index when converting to a BigMap.
res := &BigMap{kv: make([]keyValuePair, 0, m.len)}

@ldemailly ldemailly requested a review from Copilot April 6, 2025 02:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

@ldemailly ldemailly merged commit cacf124 into main Apr 6, 2025
3 checks passed
@ldemailly ldemailly deleted the unset branch April 12, 2025 02:34
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.

Add map delete of element
1 participant