Skip to content

added SetReg method#324

Open
shewer wants to merge 4 commits intohchunhui:masterfrom
shewer:patch-18
Open

added SetReg method#324
shewer wants to merge 4 commits intohchunhui:masterfrom
shewer:patch-18

Conversation

@shewer
Copy link
Copy Markdown
Contributor

@shewer shewer commented Mar 30, 2024

  • Create obj

    • Set()
    • Set({})
    • Set( ...) --> Set({...})
  • methods

    • obj_set:keys() -- return list of key
    • obj_set:set(key) -- return self
    • obj_unset:(key) -- return self
  • operator

    • << : obj_set = Set() << key1 << key2 << key3 -- set
    • >> : obj_set = Set() >> key1 >> key2 ; -- unset
    • & : obj_set1 & obj_set2 --> return obj_set3
    • | : obj_set1 | obj_set2 --> return obj_set3
    • == : obj_set1 == obj_set2 --> return bool

shewer added 4 commits March 30, 2024 13:58
Set()
* Create obj
  Set({})
  Set( ...) --> Set({...})
* methods
   obj_set:keys()  -- return list of key
   obj_set:set(key) -- return self
   obj_unset:(key) -- return self
* operator
 <<  : obj_set = Set() << key1 << key2 << key3 -- set
 >> : obj_set = Set() >> key1 >> key2 ; --  unset
  &  : obj_set1  & obj_set2 --> return obj_set3
  |  : obj_set1 | obj_set2 --> return obj_set3
  ==   :  obj_set1 == obj_set2 --> return bool
a=Set{'a','b'} 
b=Set{'a','b','c'}
c = a ~ b  -- {'c'}
d= b ~ a  --  {'c'}

a==b ---> 等同   c = a ~ b ; c:empty()
@hchunhui
Copy link
Copy Markdown
Owner

我觉得这些修改必要性不大。一方面是因为 SetReg 的功能已经完备了;另一方面 SetReg 原意只是一个最小的实现,方便 包装 C++ 接口,并不追求使用上的便利。

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