On 2011-01-08 08:58, Peter Van Roy wrote:
> On 07/01/11 21:11, Wacek Kusnierczyk wrote:
>>> It's clear that Oz has not developed its type system to the same level of
>>> sophistication as for example Haskell or Caml have done.  What it has done
>>> instead is define a simple, efficient, and flexible set of data structures
>>> in which you can program what you need.
>>
>> yes, strings as sequences of ints are (almost) unproblematic.  i was
>> referring specifically to your comment on strings and list operations, which
>> didn't really address the original question and was no justification for the
>> choice made in Oz.
>
> There are two choices: why use lists to represent strings, and why use
> integers to represent characters.  As I understand the Oz design philosophy,
> the language tries to factor concepts as orthogonally and minimally as
> possible.  Oz does not multiply concepts if the benefit is marginal.  That is
> why the type system is so simple and that is, as far as I know, why strings
> are represented as lists and characters as integers.

That depends on whether you think the benefit of being able to distinguish
strings from lists of integers is marginal. I'd say that even just considering
debuggers/inspectors, this is a significant usability issue (also in other
languages that take the same approach, such as Erlang). There are
other situations where it is useful to make this distinction; see
<https://omlog.wordpress.com/2008/09/09/erlang-string-issue/> for example.

It really wouldn't complicate the type system much. (IMHO, it is preferable
to distinguish the string and list types rather than the character and
integer types, especially in languages that allow heterogenous lists, since
it should be possible to make the distinction by inspecting the list-or-
string's tag rather than the tags of all elements.)

I strongly recommend to designers of new languages, including languages with
the same simplicity and orthogonality goals as Oz, that they distinguish
strings and lists.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

Attachment: signature.asc
Description: OpenPGP digital signature

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to