#773 closed defect (fixed)
Incremental index by name in Append
| Reported by: | Jorge | Owned by: | Víctor de Buen Remiro |
|---|---|---|---|
| Priority: | normal | Milestone: | Mantainance |
| Component: | SetAlgebra | Version: | 2.0.1 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
It would be desirable if after doing SetIndexByName on a Set the following invocation to does not invalidate the index Append and keep the Set indexed.
Change History (4)
comment:1 Changed 16 years ago by
| Status: | new → accepted |
|---|---|
| Summary: | IndexByName property permanent → Incremental index by name in Append |
comment:2 Changed 16 years ago by
| Milestone: | → Manteinance |
|---|---|
| Type: | enhancement → defect |
comment:3 Changed 16 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
comment:4 Changed 16 years ago by
There is a new optiaonal argument
Set Append(Set set1, Set set2, [Real incrementalIndexByName=False])
If incrementalIndexByName is true, then the index of names will be incremented if original set had an index and new elements are compatible with old ones; or created if set was null.
If incrementalIndexByNameis false and set had an index, then it will be removed.
Note: See
TracTickets for help on using
tickets.

Current behaviour is incoherent due Append does no remove the index nor increment it. In this example, after the call to
AppendfunctionHasIndexByNamereturnsTruebut it cannot find the new element.Set s = {[[ Real a = 1; Real b = 2; Real c = 3; Real d = 4; Real e = 5; Real f = 6 ]]}; Real ok.1 = SetIndexByName(s); Real ok.idx.1 = FindIndexByName(s,"c")==3; Set Append(s, {[[ Real g = 7 ]]}); Real ok.2 = HasIndexByName(s); Real ok.idx.2 = FindIndexByName(s,"g")==7;