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

Pages: 1-

automatic currying in scheme

Name: Anonymous 2008-11-23 23:19

is it possible without macros?

Name: THE GINIGGER 2008-11-23 23:32

Did someone say CROMA?

Name: Anonymous 2008-11-24 2:01

(require "ciel-senpai.ss")

Name: Anonymous 2008-11-24 18:37

>>2 url?

Name: Anonymous 2008-11-24 18:43

import List hiding List

Name: Anonymous 2008-11-24 18:56

>>3
I'm not interested in your shit.

Name: Anonymous 2008-11-25 0:16

>>6
What did you expect to find when haxing his anus?

Name: Anonymous 2008-11-25 13:07

>>7
EPIC!

Name: Anonymous 2008-11-25 13:49

FUCK OFF SCHEMER FAGGOTS

Name: Anonymous 2008-11-25 16:11

(faggot? >>9) ===> #t

Name: Anonymous 2008-11-25 22:09

this is the OP. is there is no such thing as functional automatic currying in any kind of lisp? is it possible with macros? (read: careful macros)

Name: Anonymous 2008-11-26 0:18

>>11
There's probably a Lisp that includes partial application, which is what I assume you meant to say. If not, make one, faggot.

Name: Anonymous 2008-11-26 0:33

>>12 no, not specifically partial application, though i'm sure it would need to exist to have a truly curryed lisp. really, im just too busy and i want you to do it for me.

Name: Anonymous 2008-11-26 2:10

>>13
What else would automatic currying mean?

Name: Anonymous 2008-11-26 2:34

((+) 1 2 3) ≡ ((+ 1) 2 3) ≡ ((+ 1 2) 3) ≡ (+ 1 2 3) ≡ (((+) 1) 2 3) ≡ (((+ 1) 2) 3) ≡ ...

i suppose that would really be some kind of laziness...

Name: Anonymous 2008-11-26 4:06

SRFI-26: Notation for Specializing Parameters without Currying

[b]Why not real currying/uncurrying?[/b]

It is possible in Scheme to implement a macro turning a multi-argument
procedure into a nesting of single-argument procedures and back. These
operations are usually called "curry" and "uncurry" in other
programming languages. Yet, Scheme remains an inherently uncurried
language and is not prepared to deal with curried procedures in a
convenient way. Hence, a "by the book" implementation of currying
would only be useful if you apply it in the sequence "curry,
specialize some arguments, and uncurry again"---which is exactly the
purpose of the macro cut specified in this document. The primary
relevance of currying/uncurrying in Scheme is to teach concepts of
combinatory logic.


http://srfi.schemers.org/srfi-26/srfi-26.html

Name: Anonymous 2008-11-26 10:39

>>16
the GitRDone cut mechanism still doesnt provide for the (((+) 1 2) 3) style currying that >>15 asks.

Name: Anonymous 2008-11-26 12:45

(define (plus . args)
  (if (null? args)
      plus
      (lambda x
        (apply plus (append args x)))))


this, unfortunately, never returns a value, only more functions

Name: Anonymous 2008-11-26 13:26

What about auto ... guess what? hax my anus!

Name: Anonymous 2008-11-26 13:28

someone's being stupid on the internet again...

if (((+) 1 2) 3) is supposed to be 6, then what is ((((+) 1 2) 3) 4) supposed to be? (6 4)?

Name: Anonymous 2008-11-26 13:29

>>20
hax my anus!

Name: Anonymous 2008-11-26 13:34

The pleasure of being cummed inside

Name: Anonymous 2008-11-26 16:08

>>20
((((+) 1 2) 3) 4) is the value 10, in a lazy lisp like >>15 suggested. get your head out of your ass

Name: Anonymous 2008-11-26 16:11

>>23
That has nothing to do with laziness. It's partial application.

Name: Anonymous 2008-11-26 16:14

The pleasure of being cummed inside

Name: Anonymous 2008-11-26 16:17

>>24
the entire Haskell programing language is automatically curried, is that also partial application?

Name: Anonymous 2008-11-26 17:06

>>26
Yes. Partial application is when you apply a function taking n arguments to only one argument, and get a function taking n-1 arguments rather than a syntax error. Automatic currying is an ungainly way of saying it. But it has nothing to do with laziness.

Name: Anonymous 2008-11-27 1:16

>>23
you don't notice anything impossible?

Name: Anonymous 2008-11-30 22:04

>>15,18,27

(define (plus . args)
  (lambda x
     (if (null? x)
         (apply + args)
         (apply plus (append args x))))))

(((plus 1) 2) 3)
(((plus) 1 2) 3)
(((plus) 1) 2 3)

The plus function returns a thunk that must be applied to 0 arguments to get the expression's value, else it will continuously bind the its arguments to the return thunk.

Methinks, only the evaluator would need to be modified to provide for a lazy LISP interpreter.

Name: Anonymous 2009-03-06 11:40

The closest to family.

Name: ​​​​​​​​​​ 2010-09-09 13:24

Name: Anonymous 2010-11-25 21:02

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