{"id":16659367,"url":"https://github.com/alexander-yakushev/defprecated","last_synced_at":"2025-06-16T13:02:54.926Z","repository":{"id":23893524,"uuid":"27273064","full_name":"alexander-yakushev/defprecated","owner":"alexander-yakushev","description":"Deprecation in Clojure made easy","archived":false,"fork":false,"pushed_at":"2019-02-22T16:56:35.000Z","size":10,"stargazers_count":58,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-24T12:05:55.056Z","etag":null,"topics":["clojure","deprecation"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexander-yakushev.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-28T15:49:39.000Z","updated_at":"2023-03-25T01:31:25.000Z","dependencies_parsed_at":"2022-08-22T07:11:02.465Z","dependency_job_id":null,"html_url":"https://github.com/alexander-yakushev/defprecated","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-yakushev%2Fdefprecated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-yakushev%2Fdefprecated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-yakushev%2Fdefprecated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-yakushev%2Fdefprecated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexander-yakushev","download_url":"https://codeload.github.com/alexander-yakushev/defprecated/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243832753,"owners_count":20355141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","deprecation"],"created_at":"2024-10-12T10:24:50.199Z","updated_at":"2025-03-16T23:31:34.452Z","avatar_url":"https://github.com/alexander-yakushev.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[[https://travis-ci.org/alexander-yakushev/defprecated/][https://travis-ci.org/alexander-yakushev/defprecated.svg?branch=master]] [[https://coveralls.io/r/alexander-yakushev/defprecated?branch%3Dmaster][https://coveralls.io/repos/alexander-yakushev/defprecated/badge.svg?branch=master]]\n* DEFprecated - deprecate all the things!\n\n  Psst, chummer! Looking for some deprecation? You've come to the right place.\n  Deprecate like never before, deprecate everything! Deprecate symbols,\n  deprecate functions and macros, deprecate arities, deprecate programming\n  languages, deprecate hardware and software, deprecate your enemies and\n  friends, deprecate your loved ones, deprecate your dog, deprecate yourself for\n  eating that donut, deprecate social institutions, deprecate social injustice,\n  deprecate government and FRS, deprecate NSA, deprecate yourself again for\n  deprecating everything, deprecate that feeling, go on deprecation spree!\n\n  /Did you just say \"deprecate your dog\"?/\n\n  No, I didn't.\n\n  /Can I deprecate this library?/\n\n  Yes, you can, but then you will be responsible for writing a new one.\n\n  Just read these testimonies!\n  #+BEGIN_QUOTE\n  Use it or delete it. There is no deprecate. -- Master Joda\n  #+END_QUOTE\n\n  #+BEGIN_QUOTE\n  We have a policy of releasing entire Java packages in which every single\n  class, interface and method is deprecated right out of the box, starting at\n  version 1.0. -- Morris Baldwin, by [[http://steve-yegge.blogspot.no/2010/07/wikileaks-to-leak-5000-open-source-java.html][Steve Yegge]]\n  #+END_QUOTE\n\n  #+BEGIN_QUOTE\n  I just do (:refer-clojure :exclude [defn defmacro]) and (:use\n  defprecated.core). Deprecating stuff has never been easier. -- Regular Joe\n  #+END_QUOTE\n\n** Man, you need help\n\n   No, wait, I got this. *defprecated* is a minimalistic library for marking\n   functions, macros and global vars as deprecated. When the time comes and you\n   realize that you made a bad API decision, mark the function as deprecated\n   instead of removing it. You'll get the best from two worlds: old users' code\n   won't crash, but they will migrate to the new API over time.\n\n** Usage\n\n   Put this into your =:depencencies=:\n\n   [[https://clojars.org/defprecated][https://clojars.org/defprecated/latest-version.svg]]\n\n   Replace any =def=, =defn= or =defmacro= you want to deprecate with a\n   corresponding macro from =defprecated.core=. For example:\n\n   #+BEGIN_SRC clojure\n(require '[defprecated.core :as depr])\n\n(depr/defn foo \"A useless function.\"\n  [x y]\n  (+ x y))\n   #+END_SRC\n\n   A few things will happen:\n   - Docstring will be updated to contain the deprecation warning.\n   - Same warning will be printed when the function is called for the first\n     time.\n\n   You can change deprecation options by editing =:deprecated= metadata for that\n   function/macro/var.\n\n   #+BEGIN_SRC clojure\n(depr/defn foo \"A useless function.\"\n  {:deprecated {:in \"0.2.5\"\n                :use-instead bar\n                :print-warning :always}}\n  [x] (+ x x))\n   #+END_SRC\n\n   Here are the possible options:\n   - =:in= --- specifies the version of the library/program when the function\n     became deprecated.\n   - =:use-instead= --- can be a string or a var name. Expands the warning message\n     to contain the alternative function/macro to be used instead of the\n     deprecated one. If var name is provided, its namespace will be also shown.\n   - =:print-warning= --- can either be =:always=, =:once= and =:never=. The\n     default is =:once=, which means warning will be printed only the first time\n     the function is called (or the macro is expanded).\n   - =:print-function= --- set a custom function for printing out warnings. By\n     default they are printed to STDERR.\n\n*** Deprecate specific arities\n\n    You can add =^:deprecated= tag to argument vectors in a multi-arity\n    function/macro.\n\n    #+BEGIN_SRC clojure\n(depr/defn baz\n  ([x]\n   (+ x x))\n  (^:deprecated [x y]\n   (+ x y))\n  ([x y z]\n   (+ x y z))\n  (^:deprecated [x y z o]\n   (+ x y)))\n    #+END_SRC\n\n    If a function/macro has at least one =:deprecated= arity, the following will\n    happen:\n\n    - The functions itself will NOT be marked as deprecated.\n    - =:forms= metadata will contain only non-deprecated arities.\n    - Warning will be printed only when deprecated arities are called.\n\n    #+BEGIN_SRC clojure\n=\u003e (baz 2 3)\nWARNING: arities ([x y] [x y z o]) are deprecated, use one of ([x] [x y z]) instead.\n5\n    #+END_SRC\n\n** License\n\n   Deprecate the licenses, this is in public domain. [[http://creativecommons.org/publicdomain/zero/1.0/][http://i.creativecommons.org/p/zero/1.0/80x15.png]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexander-yakushev%2Fdefprecated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexander-yakushev%2Fdefprecated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexander-yakushev%2Fdefprecated/lists"}