These are chat archives for Gozala/wisp

26th
Sep 2014
Irakli Gozalishvili
@Gozala
Sep 26 2014 06:53
@Nami-Doc something along this lines should work
(ns hello.world
  (:require [wisp.sequence :refer [list concat]]))

(defmacro defoperator
  [op seed f]
  `(defmacro ~op
     ([] ~seed)
     ([x] (list '~f ~seed x))
     ([x & etc] (concat (list '~f x) etc))))

(defoperator +! 0 js/plus)
ven
@vendethiel
Sep 26 2014 17:16
oooh, much thanks!
seems like I could use that. Though that's a bit limitating
actually, err, doesn't seem to work
I don't really what your code is supposed to do
it just kinda looks like (lambda (& arg) (apply + 0 arg)) :o).
(and a big part of my question was how to concat symbols, because that looks like a power I'd love to abuse :P)