I need to read any line (from user_input) into an atomic list, e.g.:
Example line, which contains any ASCII chars.
into:
[Example,'line,',which,contains,any,ASCII,'chars.']
what I've got so far:
read_line_to_codes(user_input, Input),
atom_codes(IA,Input),
atomic_list_concat(AlistI,' ',IA).
but that only works w/ single words, because of atom_codes. read/2 also complains about spaces, so is there any way to do this?
oh and maybe then splitting at comma into 2d-lists, appending the dot/exclamationmark/questionmark, e.g.:
[[Example,line],[which,contains,any,ASCII,chars],'.']
btw: that's SWI-prolog.
EDIT: found the solution:
read_line_to_codes(user_input, Input),
string_to_atom(Input,IA),
atomic_list_concat(AlistI,' ',IA),
can't answer my own question because i don't have 100 reputation :-/