Peculiar behaviour of 'parse'?
Posted: Thu Aug 12, 2004 4:12 pm
Hi Lutz,
This may be an obvious issue, but anyway:
-----------------
#!/usr/bin/newlisp
#
# Testing the 'parse' instruction
#
(set 'var (parse "Lutz Mueller created newlisp 127.0.0.1"))
(println var)
(exit)
-----------------
Now, the result of this program is:
("Lutz" "Mueller" "created" "newlisp" "127.0" ".0" ".1")
It strikes me that the IP address is splitted as well. The documentation mentions that "...when no str-break is given, parse tokenizes according newLISP's internal parse rules." However, it seems logical to expect something like the following, using space as splitter:
("Lutz" "Mueller" "created" "newlisp" "127.0.0.1")
Can you clarify in this situation the internal parse rule? I am using newLisp 8.1.0 on Slackware 9.1 Linux.
Thanx,
Peter
This may be an obvious issue, but anyway:
-----------------
#!/usr/bin/newlisp
#
# Testing the 'parse' instruction
#
(set 'var (parse "Lutz Mueller created newlisp 127.0.0.1"))
(println var)
(exit)
-----------------
Now, the result of this program is:
("Lutz" "Mueller" "created" "newlisp" "127.0" ".0" ".1")
It strikes me that the IP address is splitted as well. The documentation mentions that "...when no str-break is given, parse tokenizes according newLISP's internal parse rules." However, it seems logical to expect something like the following, using space as splitter:
("Lutz" "Mueller" "created" "newlisp" "127.0.0.1")
Can you clarify in this situation the internal parse rule? I am using newLisp 8.1.0 on Slackware 9.1 Linux.
Thanx,
Peter