Getting lists from ASCII input

orbitz@REDACTED orbitz@REDACTED
Tue May 16 00:58:34 CEST 2006


You might consider using eval or writing a more intelligent parser  
for your list, using something like yecc to write a subset of the  
erlang syntax.

On May 15, 2006, at 5:15 PM, Deryk Barker wrote:

> I'm still a (raw) beginner but...
>
> I'm trying to write a program (a client - my students will write the
> server) which needs to allow the user to enter a list in repsonse to a
> prompt.
>
> I cannot quite figure out what combination of list_to_atom and
> atom_to_list I need to do this.
>
> e.g. if the user enter:
>
> 	remove [a,b,c]
>
> I'd like to be able to get the remove as an atom and the [a,b,c] as a
> list of three atoms. Currently, I can get the list
>
> [91,97,44,98,44,99,,93]
>
> Which has the [ command and ] as terms.
>
> I'm sure I must be missing something obvious.
>
> thanks
> -- 
> |Deryk Barker, Computer Science Dept. | Music does not have to be  
> understood|
> |Camosun College, Victoria, BC, Canada| It has to be listened  
> to.           |
> |email: dbarker@REDACTED          
> |                                     |
> |phone: +1 250 370 4452               |         Hermann  
> Scherchen.          |
>




More information about the erlang-questions mailing list