Clojurians
#clojure-italy
<
2018-12-28
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

reborg17:12:01

Wat? Qualcuno puo’ spiegare?

(alter-var-root #'seque (constantly #'max))
(seque 5 10 1)
;; 10
(alter-var-root #'+ (constantly #'-))
(+ 1 1)
;; 2
+
;; #'clojure.core/-

reborg17:12:09

ustia vero

bronsa17:12:55

user=> (alter-var-root #'+ (constantly #'-))
#'clojure.core/-
user=> (+ 1 1)
2
user=> (alter-meta! #'+ dissoc :inline-arities :inline)
{:added "1.2", :ns #object[clojure.lang.Namespace 0x64ba3208 "clojure.core"], :name +, :file "clojure/core.clj", :column 1, :line 984, :arglists ([] [x] [x y] [x y & more]), :doc "Returns the sum of nums. (+) returns 0. Does not auto-promote\n  longs, will throw on overflow. See also: +'"}
user=> (+ 1 1)
0

reborg17:12:12

si si, mi era sfuggito nella foga

reborg17:12:27

stava usando Numbers/add

reborg17:12:24

(+ 1) => -1

reborg18:12:06

Tra l’altro, ecco perche’ certe volte with-redefs misteriosamente non funziona…