Re: new map type (Re: Ann: SWI-Prolog 7.1.0)
Alan Baljeu <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hm. I'm not a fan of this. If functional notation is good, it's good for all types, not just maps. Meanwhile, this has an appearance of being object oriented while apparently not being bound to any particular map-type, which means it's not at all OO. This syntax also gets in the way of any kind of term manipulation. There's a reason for both "X = 3+4" and "X is 3+4". I think bypassing that is neither good for learning nor advanced use. Of course I'm free to ignore this feature, and I probably would. Alan Baljeu ----- Original Message ----- From: Jan Wielemaker <[email protected]> To: Alan Baljeu <[email protected]>; Prolog mailing list <[email protected]> Cc: Sent: Sunday, November 24, 2013 11:50:07 AM Subject: Re: [SWIPL] new map type (Re: Ann: SWI-Prolog 7.1.0) On 11/23/2013 11:51 PM, Alan Baljeu wrote: >>>> plus(Map.key, 2,3) > >> >> It is equivalent to >> >> get_map_ex(key, Map, V), >> plus(V, 2, 3). > > Understood. > >>>> Vector.multiply(V2) > > > You still haven't explained this. Does this mean get_map_ex(multiply, Vector, V2)? See "5.4.1.1 User defined functions on maps" in http://www.swi-prolog.org/pldoc/man?section=maps Cheers --- Jan