Jump to content

Recommended Posts

Posted

Hi Guys,

I want to set a long list of elements in one variable

 

(setq X

(list

..........

.........

))

 

and after compiling I am receiving the following message:

 

; warning: unsafe redefinition of LIST symbol, conflicts with long LIST translation: LIST

 

Is there any restrictions about length of list?

 

Thanks

Posted

You haven't got

 

(defun list ...

 

Anywhere have you?

Posted

My code is:

 

 

(defun SHS-CF-EN-list ()

(setq SHS-CF-EN ; 
(list
"20x2x4" 20.00 2.00 4.00 2.00 1.05 1.34 0.69 0.72 0.69 0.88 1.21 1.06 0.073
"20x2.5x5" 20.00 2.50 5.00 2.50 1.25 1.59 0.77 0.69 0.77 1.00 1.39 1.19 0.071
"25x2x4" 25.00 2.00 4.00 2.00 1.36 1.74 1.48 0.92 1.19 1.47 2.53 1.80 0.093
"25x2.5x5" 25.00 2.50 5.00 2.50 1.64 2.09 1.69 0.90 1.35 1.71 2.97 2.07 0.091
"25x3x6" 25.00 3.00 6.00 3.00 1.89 2.41 1.84 0.87 1.47 1.91 3.33 2.27 0.090
"30x2x4" 30.00 2.00 4.00 2.00 1.68 2.14 2.72 1.13 1.81 2.21 4.54 2.75 0.113
"30x2.5x5" 30.00 2.50 5.00 2.50 2.03 2.59 3.16 1.10 2.10 2.61 5.40 3.20 0.111
"30x3x6" 30.00 3.00 6.00 3.00 2.36 3.01 3.50 1.08 2.34 2.96 6.15 3.58 0.110
"40x2x4" 40.00 2.00 4.00 2.00 2.31 2.94 6.94 1.54 3.47 4.13 11.30 5.23 0.153
"40x2.5x5" 40.00 2.50 5.00 2.50 2.82 3.59 8.22 1.51 4.11 4.97 13.60 6.21 0.151
......................
and may more rows

)
)
)

 

this list is very long.

In process of compiling from Vlide I am receiving

; warning: unsafe redefinition of LIST symbol, conflicts with long LIST translation: LIST

:huh:

Posted

You may be better making each member-section definition a list in the SHS-CF-EN list.

.. 2 reasons

reduce the elements in the SHS-CF-EN list

allow an (assoc SHS-CF-EN ) to return the member data.

 

What does (length SHS-CF-EN) return ??

Posted

(length SHS-CF-EN)
474

 

 

there are - 474 elements

Posted

474 isn't too many - I thought we were talking thousands... I'm not sure that the length would cause the problem...

Posted
(length SHS-CF-EN)
474

 

 

there are - 474 elements

 

seems you have a few sizes that don't have 14 elements per item ... just an observation.

 

I'd need to see the code, but I see no issue with the list length.

 

Does it load and run correctly from the editor ?

What compile mode are you using ?

Posted

I've just run a test.

255 element list compiles without warning

a 256 element list generates a warning.

 

Both loaded and ran as .LSP files from the IDE.

 

The file compiled, loaded and ran correctly without error.

 

[COMPILING K:/KDUBPro2010/xxxxx.lsp]

;;XXXX

; warning: unsafe redefinition of LIST symbol, conflicts with long LIST translation: LIST

; === STATISTICS: XXXX

; external globals are (MYLIST)

; function calls to be linked (LIST)

; not linked function calls (LENGTH)

; === STATISTICS: "K:/KDUBPro2010/xxxxx.lsp"

; not dropped function names (XXXX)

Posted
seems you have a few sizes that don't have 14 elements per item ... just an observation.

 

I'd need to see the code, but I see no issue with the list length.

 

Does it load and run correctly from the editor ?

What compile mode are you using ?

 

The program works correct.

The compile mode is simple

 

May be for correct compilation the max length of list is 256 elements?!

Posted
The program works correct.

The compile mode is simple

 

May be for correct compilation the max length of list is 256 elements?!

 

LESS than 256 .... 'cause 256 generates a warning.

Posted

As I mentioned earlier, you may be best making a list of lists

 

similar to ;

 

(defun SHS-CF-EN-list ()
 (setq SHS-CF-EN
        (list
          '("20x2x4" 20.00 2.00 4.00 2.00 1.05 1.34 0.69 0.72 0.69 0.88 1.21 1.06 0.073)
          '("20x2.5x5" 20.00 2.50 5.00 2.50 1.25 1.59 0.77 0.69 0.77 1.00 1.39 1.19 0.071)
          '("25x2x4" 25.00 2.00 4.00 2.00 1.36 1.74 1.48 0.92 1.19 1.47 2.53 1.80 0.093)
          '("25x2.5x5" 25.00 2.50 5.00 2.50 1.64 2.09 1.69 0.90 1.35 1.71 2.97 2.07 0.091)
          '("25x3x6" 25.00 3.00 6.00 3.00 1.89 2.41 1.84 0.87 1.47 1.91 3.33 2.27 0.090)
          '("30x2x4" 30.00 2.00 4.00 2.00 1.68 2.14 2.72 1.13 1.81 2.21 4.54 2.75 0.113)
          '("30x2.5x5" 30.00 2.50 5.00 2.50 2.03 2.59 3.16 1.10 2.10 2.61 5.40 3.20 0.111)
          '("30x3x6" 30.00 3.00 6.00 3.00 2.36 3.01 3.50 1.08 2.34 2.96 6.15 3.58 0.110)
          '("40x2x4" 40.00 2.00 4.00 2.00 2.31 2.94 6.94 1.54 3.47 4.13 11.30 5.23 0.153)
          '("40x2.5x5" 40.00 2.50 5.00 2.50 2.82 3.59 8.22 1.51 4.11 4.97 13.60 6.21 0.151)
          ;;......................
          ;;and may more rows
         )
  )
  ;; < ... >
)

 

Then extract the item you want ...

 

(setq ItemList (assoc "30x2.5x5" SHS-CF-EN))

;;-> ("30x2.5x5" 30.0 2.5 5.0 2.5 2.03 2.59 3.16 1.1 2.1 2.61 5.4 3.2 0.111)

Posted

Hi, I had the same warning error , with a 10000 + sublist in a list .

 

Seem to be it is a limit from ACAD , like you can not have more than 256 selections sets.

Posted

Is the routine working well?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...