Using erlang as script language

Héctor Rivas Gándara keymon@REDACTED
Thu Dec 30 12:51:06 CET 2004


El Martes, 28 de Diciembre de 2004 23:11, Taavi Talvik escribió:

> > What do you think about this?
> You can threat XUL render motor as port program. Actually you need quite
> simple interface between erlang and XUL.
> XUL server:
>   ObjectId = create_object(type)
>   [{Attr1,Val1},..] = get_attribute(ObjectId, [attribute,..]
>   set_attribute(ObjectId, [{Attr1,Val1},..}])
>   send_event(ObjectId, Event, [Attrs,..])

I don't like that approach, but its easy to implement.
The problem is that it's difficult to write something like:

ObjectId = create_object(object_class),
[{an_attrib, Value}] = get_attribute(ObjectId, [an_attrib]),
set_attribute(ObjectId, an_attrib, Value+1).

instead of something like this:

ObjectId#an_attrib = ObjectId#an_attrib+1.

Imagine when you have to navigate throw widgets:

APanel#child[3]#get_element(a_contained_widget)#text. 

-- 
Greets



More information about the erlang-questions mailing list