Author Topic: How to get nth item from list in list  (Read 3798 times)

0 Members and 1 Guest are viewing this topic.

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: How to get nth item from list in list
« Reply #15 on: April 06, 2018, 04:35:40 PM »
Code: [Select]
(defun _Atoms ( x / tmp )
  (if (atom x)
    (list x)
    (append (_Atoms (car x)) (if (setq tmp (cdr x)) (_Atoms tmp)))
  )
)
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to get nth item from list in list
« Reply #16 on: April 06, 2018, 04:42:27 PM »
Nice if it works (Im on my phone).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: How to get nth item from list in list
« Reply #17 on: April 06, 2018, 04:50:38 PM »
Nice if it works (Im on my phone).

Yup, it seems to..
BTW didn't ment to raise a problem about it, rather a possible requirement.  :tongue2:
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to get nth item from list in list
« Reply #18 on: April 06, 2018, 04:59:33 PM »
Worry not Grrr. Ive been burnt out for months; posting tends to be sporadic / minimal but Im grateful and enjoy the illumination no less that always springs from forum play. Thanks and cheers.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: How to get nth item from list in list
« Reply #19 on: April 06, 2018, 05:07:02 PM »
Worry not Grrr. Ive been burnt out for months; posting tends to be sporadic / minimal but Im grateful and enjoy the illumination no less that always springs from forum play. Thanks and cheers.

Glad to hear that, Michael !
We all have our days - but one thing is sure: everyone gains knowledge/solutions by only participating in this forum. :)
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg