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

On Tue, 4 Mar 2014, Thompson, David wrote:

> 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
>
>
Hi,
   I agree, I wouldn't define 1+"foo" or []+{} (and I haven't done so in my 
article). I guess you have the "WAT" talk [2] at "Destroy all Software" 
in mind ;)
   I think that GOOPS makes sense because without being able to extend '+',
user-defined numeric classes (e.g. hypercomplex numbers) always would be 
second class citizens compared to Guile's integers, floating point 
numbers, and complex numbers.
   Anyway, I need to collect some experience with this in Scheme myself. 
But I hope it will work out well.

Regards
Jan

[2] https://www.destroyallsoftware.com/talks/wat





  parent reply	other threads:[~2014-03-04 17:41 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
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   ` Jan Wedekind [this message]
2014-03-05 11:28   ` Article about GNU Guile and GOOPS 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=alpine.DEB.2.02.1403041733130.23623@wedemob.home \
    --to=jan@wedesoft.de \
    --cc=dthompson2@worcester.edu \
    --cc=guile-user@gnu.org \
    /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).