Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

subst behaves differently depending on replacement value

1 REPLY 1
Reply
Message 1 of 2
JamesMaeding
312 Views, 1 Reply

subst behaves differently depending on replacement value

I ran into this odd behavior, try:

(SUBST

  (LIST "NAMES" (LIST (LIST (LIST "A" 2) (LIST "B" 2) "C")))

  (LIST "NAMES" NIL)

  (LIST (LIST "ASDASD" 1)(LIST "NAMES" NIL))

)

 

that should fill in the (LIST "NAMES" NIL") with the triple neseted list I told it to.

Instead, it fills in the NIL of (LIST "NAMES" NIL") with the value.

So I get this:

(("ASDASD" 1)(LIST "NAMES"  ("NAMES" ((("A" 2) ("B" 2) "C")))))

instead of

(("ASDASD" 1)(LIST "NAMES" ((("A" 2) ("B" 2) "C"))))

 

I've never seen subst do that, is this normal?

 

Alternative is to use a loop to build the modified list...


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

1 REPLY 1
Message 2 of 2
JamesMaeding
in reply to: JamesMaeding

I fooled myself, it does work.

I read the vlide debug inspect window wrong 10 times in a row. 11th was the charm....


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost