Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When did the metadata reader syntax change from #^ to ^?

Tags:

clojure

Currently (Clojure v1.6) you can give a type hint two ways:

^floats xs
#^floats xs

According to Clojure ^floats vs. #^floats?, the latter is legacy syntax, and the former is the current preferred form.

When did that change happen?

like image 745
DaoWen Avatar asked May 25 '15 20:05

DaoWen


People also ask

What is the syntax of the metadata?

Syntax. Metadata (metacontent) syntax refers to the rules created to structure the fields or elements of metadata (metacontent). A single metadata scheme may be expressed in a number of different markup or programming languages, each of which requires a different syntax.

When was metadata first used?

The first recorded use of metadata dates to the Great Library of Alexandria in 280 B.C. Check out this infographic that details the entire history of what we now call "metadata".

What are the three types of metadata?

There are three main types of metadata: descriptive, administrative, and structural.


1 Answers

A brief history of the ^ macro character

  • In Clojure v1.0, the ^ character is the "meta reader macro". In other words, ^x was shorthand for (meta x). #^ was used to associate metadata with an object. (See the Macro Characters documentation from November 2009.)

  • At some point, someone probably realized that having special cases for both #^ and ^, both related to metadata, was confusing. They decided to deprecate ^, with the plan to eventually replace #^ with ^. In Clojure v1.1, the ^ reader macro was officially deprecated. (See the Macro Characters documentation from January 2010.)

  • There's a commit on April 26, 2010 on Github that replaces the old ^ behavior with the #^ behavior. (This is when #^ and ^ became synonymous.)

  • In the Clojure v1.2 release, #^ was deprecated in favor of ^. (See the Macro Characters documentation from August 2010.)

  • They removed the last few instances of #^ from clojure.core back in 2013, sometime before the Clojure v1.6 release.

like image 99
DaoWen Avatar answered Sep 22 '22 13:09

DaoWen