Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

<>

Name: Anonymous 2008-01-12 14:24

or != ?

Personally, I prefer != because not all inequalities can be described by a combination of less than and greater than.

Name: Anonymous 2008-01-12 14:26

<> for numbers, != for anything else.
!== and !=== when using faggot languages.

Name: Anonymous 2008-01-12 14:27

Name: Anonymous 2008-01-12 14:36


(define /=
  (lambda (x . y)
    (not (apply = (cons (x y))))))

Name: Anonymous 2008-01-12 14:41

>>4
/= is division, not inequality.

Name: Anonymous 2008-01-12 14:56

>>5 Algol-derived language faggot

Name: Anonymous 2008-01-12 14:59

Name: Anonymous 2008-01-12 15:01

>>4 faggot:
(define /= (lambda args (not (apply = args))))
And you can even omit the lambda if you do it decently

Name: Anonymous 2008-01-12 15:28

=/ a a :: a -> a -> Bool
=/ a a = not (a = b)


What the fuck this sucks multiple balls.

Name: Anonymous 2008-01-12 15:30

Someone program an example of an amazing swap

Name: Anonymous 2008-01-12 15:37

>>10
(define (swap pair)
  (cons (cdr pair) (car pair)))

Name: Anonymous 2008-01-12 15:41

>>8
(define /= (negate =))

Name: Anonymous 2008-01-12 15:59

(defmacro swap (a b)
  (rotatef a b))

Name: Anonymous 2008-01-12 20:15

            a, b = b, a

Name: Anonymous 2008-01-13 0:20

(define negate (lambda (f) (lambda (a) (not (f a)))))

(define -ify (lambda (q) (lambda (f) (lambda (a) (q (f a))))))
(define negate (-ify not))

Name: Anonymous 2008-01-13 0:21

(define negate (λ (f) (λ (a) (not (f a)))))

(define -ify (λ (q) (λ (f) (λ (a) (q (f a))))))
(define negate (-ify not))

Name: Anonymous 2008-01-13 1:04

In mathematics, != means ``factorial equals''
That is, to say 8!=9 means ``Eight factorial equals Nine'' which is incorrect. Clearly <> is the correct way, since Math was here first. Take that Computer Science fags

Name: Anonymous 2008-01-13 5:33

>>17

Name: Anonymous 2008-01-13 5:36

<=>

Name: Anonymous 2008-01-13 6:05


GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> let a ≠ b = a /= b
Prelude> :t (≠)
(≠) :: (Eq a) => a -> a -> Bool
Prelude> 1 ≠ 1
False
Prelude> 1 ≠ 2
True

Name: Anonymous 2008-01-13 6:12

>>20
let (≠) = (/=)

Name: Anonymous 2008-01-13 8:59

>>1
/=

Name: Anonymous 2008-01-13 9:27

(define (/= a b . r)
  (and (not (= a b))
       (if (pair? r)
           (apply /= (cons b r))
           #t)))



(/= 1 1) => #f
(/= 1 2) => #t
(/= 1 2 2) => #f
(/= 1 2 3) => #t

Name: Anonymous 2008-01-13 9:28

>>21
I tried that, but:

GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> let (≠) = (/=)
Prelude> :t (≠)
(`) :: () -> () -> Bool
Prelude> 1 ≠ 2

<interactive>:1:4:
    No instance for (Num ())
      arising from the literal `2' at <interactive>:1:4
    Possible fix: add an instance declaration for (Num ())
    In the second argument of `(`)', namely `2'
    In the expression: 1 ` 2
    In the definition of `it': it = 1 ` 2


:(

Name: Anonymous 2008-01-13 9:29

>>20
WOW UNICODE? IEVER NEVEREVER SEEN DAT BEEFORE

Name: Anonymous 2008-01-13 9:36

(define (/= a b . r) (and (not (= a b)) (or (null? r) (apply /= b r))))

Name: Anonymous 2008-01-13 9:42

GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> 1 ≠ 2
21

Name: Anonymous 2008-01-13 10:03

>>27
Actually should give a lexical error.

Name: Anonymous 2008-01-13 10:07

>>17
You, fir, sail.

Name: Anonymous 2008-01-13 11:14

>>23,26 You fail!
> (/= 2 1 2)
#t


Name: Anonymous 2008-01-13 14:40

>>30
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006

[1]> (/= 2 1 2)
NIL
[2]>
Adiós.

Name: Anonymous 2008-01-13 14:43

>>31
JEWS

Name: Anonymous 2008-01-13 14:43

>>30
One is not equal to two, and two is not equal to one. Looks right to me. If you want it to say none of them are equal it would be more complex to write...

Name: Anonymous 2008-01-13 14:54

  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Name: Anonymous 2008-01-13 14:57

(define (/= . terms)
  (define (test ts acc)
    (if (pair? ts)
        (if (any (lambda (x) (eqv? x (car t))) acc)
            #f
            (test (cdr t) (cons (car t) acc)))
        #t))
  (test terms '()))


Of course, this can be cut down a bit by cutting the ifs.

(define (/= . terms)
  (let test ((ts terms) (acc '()))
    (or (not (pair? ts))
        (and (not (any (lambda (x) (eqv? x (car ts))) acc))
             (test (cdr ts) (cons (car ts) acc))))))


Might make for less readable code, however.

Name: Anonymous 2008-01-14 9:03

>>15
You have no partial application, fool!

Name: Anonymous 2009-03-18 3:27

Don't call me gay, but I need some mary jay!

Marijuana MUST be legalized.

Name: ​​​​​​​​​​ 2010-10-24 15:38

Don't change these.
Name: Email:
Entire Thread Thread List