Re: Comparison operators for strings /and/ numbers?

2017-09-18 Thread Christopher Howard
On Thu, 2017-08-24 at 10:05 +0200, David Kastrup wrote: > Christopher Howard writes: > > > Hi, in another lisp I have been working with, it has <, >, and == > > (structure equality) operators which can take string arguments, > > number > > arguments, or a mixture

Re: Comparison operators for strings /and/ numbers?

2017-08-24 Thread Arne Babenhauserheide
Ralf Mattes 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

Re: Comparison operators for strings /and/ numbers?

2017-08-24 Thread Chris Vine
On Wed, 23 Aug 2017 22:05:37 -0800 Christopher Howard wrote: > Hi, in another lisp I have been working with, it has <, >, and == > (structure equality) operators which can take string arguments, number > arguments, or a mixture of both. But it seems in guile that

Re: Comparison operators for strings /and/ numbers?

2017-08-24 Thread Ralf Mattes
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. Of course you still need to define the method specialized on strings. > :3:0: :3:0:

Re: Comparison operators for strings /and/ numbers?

2017-08-24 Thread Arne Babenhauserheide
Hi Christopher, You can use GOOPS to make them generic: > (import (oop goops)) > (< "a" "b") :3:0: :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 ) (b )) (string (< "a" "b") $1 = #t

Re: Comparison operators for strings /and/ numbers?

2017-08-24 Thread David Kastrup
Christopher Howard writes: > Hi, in another lisp I have been working with, it has <, >, and == > (structure equality) operators which can take string arguments, number > arguments, or a mixture of both. But it seems in guile that there are > separate comparison

Comparison operators for strings /and/ numbers?

2017-08-24 Thread Christopher Howard
Hi, in another lisp I have been working with, it has <, >, and == (structure equality) operators which can take string arguments, number arguments, or a mixture of both. But it seems in guile that there are separate comparison operators for strings and for numbers. This makes sense but is not very