unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: Jan Wedekind <jan@wedesoft.de>
Cc: General Guile related discussions <guile-user@gnu.org>
Subject: Re: Article about GNU Guile and GOOPS
Date: Tue, 4 Mar 2014 09:03:18 -0500	[thread overview]
Message-ID: <CAJ=RwfZNgauBPFdRuwBaXT3YM8hCdrCNTwck=ttnDr0Sr=cRyg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1403041244320.11860@wedemob.home>

On Tue, Mar 4, 2014 at 7:57 AM, Jan Wedekind <jan@wedesoft.de> wrote:
> Hi,
>   I have written a small blog post about object-oriented programming with
> GNU Guile and GOOPS [1]. Having used the Ruby programming language for some
> time, I am quite spoiled when it comes to objects ;)
>   It took me a while to figure out defining constructors and dynamic
> instantiation of OO primitives. I hope it'll save somebody else some time
> one day.
>   Any comments and suggestions are welcome.
>
> Regards
> Jan
>
> [1] http://wedesoft.de/oop-with-goops.html

Hi Jan,

I think it's a nice little introduction to GOOPS.

I want to discuss this particular point from the post, because it is
shared by many other people: "... one thing I don't like about Scheme
is that there are different function names for each type of arguments.
E.g. adding numbers is done with +, adding lists is done with append,
and adding strings is done with string-append."

Having spent many years now working with object oriented programming
languages, I hold the opposite opinion.  I think it's awkward to have
a single '+' operator for all sorts of different operations on many
different types.  Adding numbers is different than concatenating
strings or lists and using the same symbol for them leads to
confusion.  Look at JavaScript for all of the crazy things that happen
when you add together different types of data: The expression 1 +
"foo" returns "1foo"!  [] + {} returns "[object Object]"! WTF?  Ruby
tends to be a bit more sane in this regard, but I think the point
still stands that operator overloading leads to confusion and strange
behavior.

WDYT?

- Dave



  reply	other threads:[~2014-03-04 14:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 12:57 Article about GNU Guile and GOOPS Jan Wedekind
2014-03-04 14:03 ` Thompson, David [this message]
2014-03-04 15:16   ` Panicz Maciej Godek
2014-03-04 18:00     ` Jan Wedekind
2014-03-04 21:17       ` Yawar Amin
2014-03-05 18:12     ` Interesting project proposal for generics in Racket Jan Wedekind
2014-03-08  9:40       ` Panicz Maciej Godek
2014-03-04 17:41   ` Article about GNU Guile and GOOPS Jan Wedekind
2014-03-05 11:28   ` Nala Ginrut
2014-03-04 14:26 ` Neil Jerram
2014-03-05 15:23 ` Andrew Gwozdziewycz
2014-03-05 17:52   ` Jan Wedekind

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ=RwfZNgauBPFdRuwBaXT3YM8hCdrCNTwck=ttnDr0Sr=cRyg@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=guile-user@gnu.org \
    --cc=jan@wedesoft.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).