Thursday, January 08, 2009     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: Remove repeat item from a list
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
leonlee
Posts: 81
Online: User is Offline
2/24/2006 12:08 AM  
I have tried some way to remove some repeat item from a list.
Followed is the simple one

foreach(item list
list=cons(item remove(item list))
)

Do anyone have a more available command or fuction?

Leon Lee
Schneider-Electric
natebizu
Posts: 0
Online: User is Offline
2/24/2006 7:19 AM  
This is what I use...

procedure(_removeDuplicates(masterList)
let((finalList)
foreach(item masterList
unless(member(item car(finalList))
finalList=tconc(finalList item)
)
)
finalList
)
)

If your are going through a list of dbids, then you can use memq instead of member to speed this up.
Geoffm
Posts: 0
Online: User is Offline
4/12/2006 12:20 PM  
I use "makeTable" because it doesn't accept duplicates.


below is code from a program I wrote called highlight_padstacks.il that is in the downloadable user skill zip file from cadence. I make a list by selecting all pins and via, and then load the names into a table.

padstacklist=makeTable("atable1" 0) 

axlSetFindFilter(?enabled list("noall" "pins" "vias")
         ?onButtons list("noall" "pins" "vias"))
axlAddSelectAll()
pin_list = axlGetSelSet()

foreach(pin_db pin_list
         
  padstack_db = pin_db->definition     ;Extract PadstackID from pinID
  pad_name=padstack_db->name      ;Extract Padstack Name from PadstackID
  padstacklist[pad_name]=pad_name  ;Load into table as Name:Value
                                                               
);end foreach
leonlee
Posts: 81
Online: User is Offline
1/18/2007 12:49 AM  
Now I use below code to this solution:

procedure( RemoveDuplicateItem(A)
B=nil
while(A!=nil B=cons(nth(0 A) B) A=remove(nth(0 A) A))
B
);procedure

Leon Lee
Schneider-Electric
kerchunk
Posts: 0
Online: User is Offline
1/18/2007 1:17 AM  
You could try using the unique function

For example, this will weed out all duplicate via names from a list:
via_name_list = unique(sort( via_name_list 'alphalessp))


A more-generic-but-trickier method involves using a foreach loop and the member funtion.
Someting like:


ulist = nil
foreach( obj obj_list
unless( member( obj ulist)
ulist = cons( obj ulist)
);end-unless
);end-foreach



HTH,

Chris Walters
local Cadence guru
()

PS - anyone know of a position for a(nother) Cadence guru?


leonlee
Posts: 81
Online: User is Offline
1/18/2007 6:10 PM  
It's wonderful for the unique function. which user guide offers these functions?

I don't know the Cadence guru position. where~~

Leon Lee
Schneider-Electric
Posting to forums is available to community members only.
Login or Register

Forums > Silicon-package-board > Shared code - SKILL > Remove repeat item from a list


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.