unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Arne Babenhauserheide <arne_bab@web.de>
To: Ralf Mattes <rm@seid-online.de>
Cc: Guile User Mailing List <guile-user@gnu.org>
Subject: Re: Comparison operators for strings /and/ numbers?
Date: Thu, 24 Aug 2017 19:58:42 +0200	[thread overview]
Message-ID: <87y3q8j16i.fsf@web.de> (raw)
In-Reply-To: <20170824101714.cvb6mhuaq44rqyp3@seid-online.de>

[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]


Ralf Mattes <rm@seid-online.de> writes:

> On Thu, Aug 24, 2017 at 10:29:41AM +0200, Arne Babenhauserheide wrote:
>> Hi Christopher,
>> 
>> You can use GOOPS to make them generic:
>> 
>> > (import (oop goops))
>> > (< "a" "b")
>
> That's not what David suggested.

No, it is not. I wrote my reply before I saw his.

>> <unnamed port>:3:0: <unnamed port>:3:0: In procedure <: Wrong type argument in position 1: "a"
>> 
>> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
>> [1]> (define-method (< (a <string>) (b <string>)) (string<? a b))
>> [1]> (< "a" "b")
>> $1 = #t
>> 
>> For some functions you might need to call (define-generic <function>)
>> before this (you’ll notice because define-method will signal an error).
>
> Is that still the case?

Yes. Try:

> (import (oop goops))
> (define-method (list (a <string>)))
ERROR: In procedure scm-error:
ERROR: #<procedure list _> is not a valid generic function

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-08-24 17:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  6:05 Comparison operators for strings /and/ numbers? Christopher Howard
2017-08-24  8:05 ` David Kastrup
2017-09-19  4:27   ` Christopher Howard
2017-08-24  8:29 ` Arne Babenhauserheide
2017-08-24 10:17   ` Ralf Mattes
2017-08-24 17:58     ` Arne Babenhauserheide [this message]
2017-08-24 13:31 ` Chris Vine
2017-08-24 13:41   ` Chris Vine

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=87y3q8j16i.fsf@web.de \
    --to=arne_bab@web.de \
    --cc=guile-user@gnu.org \
    --cc=rm@seid-online.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).