Swami Tota Ram Shankar
2012-10-21 10:37:08 UTC
Friends, I am trying to read text from a file opened in emacs and
recognize it as array or list so that I can do some vector additions
using mapcar.
I am mainly stuck at the stage of converting the string text to array
or list.
The method which I use to locate the text is "looking-at" function and
the regexp works.
(when (looking-at "[[0-9.+-\\ ]+]")
some code that is to play around for debugging and messaging and
checking the match
(forward-char (+ (string-width (match-string 0)) 1))
(setq V (match-string 0))
(setq V (intern (match-string 0)))
The cursor is placed on the start bracket, ie "["
and text looks like for example array of indefinite length
[17.16 -17.16 17.16 17.16 17.16 17.16 17.16 17.16]
Please suggest some different solutions that can take the string
matched, match-string for example and convert to a list or an array on
which I can do mapcars or lambdas.
Thanks
Swami
recognize it as array or list so that I can do some vector additions
using mapcar.
I am mainly stuck at the stage of converting the string text to array
or list.
The method which I use to locate the text is "looking-at" function and
the regexp works.
(when (looking-at "[[0-9.+-\\ ]+]")
some code that is to play around for debugging and messaging and
checking the match
(forward-char (+ (string-width (match-string 0)) 1))
(setq V (match-string 0))
(setq V (intern (match-string 0)))
The cursor is placed on the start bracket, ie "["
and text looks like for example array of indefinite length
[17.16 -17.16 17.16 17.16 17.16 17.16 17.16 17.16]
Please suggest some different solutions that can take the string
matched, match-string for example and convert to a list or an array on
which I can do mapcars or lambdas.
Thanks
Swami