[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
curly-infix in dotted notation
This page is part of the web mail archives of SRFI 105 from before July 7th, 2015. The new archives for SRFI 105 contain all messages, not just those from before July 7th, 2015.
- To: srfi-105@xxxxxxxxxxxxxxxxx
- Subject: curly-infix in dotted notation
- From: Alan Manuel Gloria <almkglor@xxxxxxxxx>
- Date: Mon, 17 Sep 2012 08:17:06 +0800
- Delivered-to: srfi-105@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=kxg4WF0AVS4pt+9jM7jT+OOXWltbwe0zlxLspkEFmA4=; b=WM+27JNyr/Ra4nYDNSm72x9sS/oUKk9N0h06N37pPmqlIRJ2b7e5kWQkVrTUbGTymT KSs3HDLKn1l0+PO2xea3uzazthJNGOsV6k3T4+NJWPRAsvOVv7+yb1L8h4F+pHqpI2OO gHvjkFCbP0gajbKhgiRCT5mP6di+PcvRnm0UlzezPjiehC672lpwv4FSo8INRC6RNDuM Gh1DS26FJ+NMbRNAKPdoHs4KEqSNvSvWDo1VlucSwUcGe9MellQBC4CLqOG3h/FmKwNU KglliqynHRAvXm3c2kD3XYIDnlNuktzvNW3Xgq96+L5Zf4V/8sZrg6lhEY14+qB5QmJT vWJQ==
You know, an s-expr of the form:
(superop op a b c ...)
can be expressed in a curly-infix dotted notation as:
(superop . {a op b op c op ...})
So for example, if you want a list of the sum of the numbers in two
other lists as and bs:
(map . {as + bs})
And if you want a procedure that adds 2 to its argument:
(cut . {<> + 2})
Interesting....
Sincerely,
AmkG