Hi Henrik,

> (dm split> (L Subject)
> ...
>             (while (match '(@A ~L @B) Subject)
> ...
> 
> It isn't working because it seems that ~L returns a NIL, how come and how

As the name says, '~' is a read-macro. It is expanded at read time (when
the function is read from the source file), while 'L' is bound later at
runtime.

To achieve what you want to do, you need to build up the pattern at
runtime, e.g. with:

   (while (match (append '(@A) L '(@B)) Subject)


BTW, some notes (SCNR):

1. Constant lists that start with a number don't need to be quoted:

   (setq Tst '(4 4))

could be just

   (setq Tst (4 4))

This is both smaller and faster.


2. The check with 'lst?'

> (dm chopStr> (Str)
>    (if (lst? Str) Str (chop Str)))

is not needed, as 'chop' handles this logic (keeping lists as they are)
by itself. So instead of 'chopStr>' you could simply use 'chop'.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to