R
Reotaro Hashemoto
Guest
Hi,
I've a sting in an ASCII file like this:
myList='(
(aa aaa)
(bb bbb)
(cc ccc)
...
)
I loaded the file, so that, I'm assumed to have myList defined
I want to make a loop over each pair like this:
foreach( (first second) myList
printf("---- %L---- %L -----\n" first second)
)
This is not working because forach first argument must be of type 's'
I have tried:
foreach( pair myList
first=car(pair)
second = cdr(pair)
printf("---- %L---- %L -----\n" first second)
)
the output is what I need, but with an error at the end:
"*Error* car: argument #1 should be a list (type template = "l")
- ..."
What does that mean? How to fix?
Thanks,
Ahmad
I've tried it the same way as I described above, but is giving syntax
error
I've a sting in an ASCII file like this:
myList='(
(aa aaa)
(bb bbb)
(cc ccc)
...
)
I loaded the file, so that, I'm assumed to have myList defined
I want to make a loop over each pair like this:
foreach( (first second) myList
printf("---- %L---- %L -----\n" first second)
)
This is not working because forach first argument must be of type 's'
I have tried:
foreach( pair myList
first=car(pair)
second = cdr(pair)
printf("---- %L---- %L -----\n" first second)
)
the output is what I need, but with an error at the end:
"*Error* car: argument #1 should be a list (type template = "l")
- ..."
What does that mean? How to fix?
Thanks,
Ahmad
I've tried it the same way as I described above, but is giving syntax
error