如何在Clojure中搜索特殊字符? [英] How do I search for special characters in Clojure?

查看:91
本文介绍了如何在Clojure中搜索特殊字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Clojure使用许多特殊字符,例如




  • ^ String

  • #(xyz ...)

  • %&

  • #_(此处为某些形式)

  • >!



等等。考虑到Google etal 大多会忽略网页中的特殊字符和搜索字符串,我该如何搜索这些特殊字符的文档?

解决方案

这个问题和其他人提出了一个重要的话题:找到Clojure源代码中使用的特殊字符的文档通常很困难且令人沮丧。



首先要注意的是Clojure文档本身。甚至还有一个专门用于该主题的页面:





许多特殊字符是称为 Reader Literals (阅读器文字),其中也包含文档页面:





您还可以找到有关特殊字符的提示。它们的用法:





最后,搜索引擎 SymbolHound.com 可以搜索Google&其他人忽略。例如,请考虑以下Clojure代码:

 (defn lines 
给出一个开放的阅读器,返回一个懒惰的序列行
[^ java.io.BufferedReader阅读器]
(获取身份(反复为#(。readLine阅读器))))

我们如何在第三行中搜索 ^ java.io.BufferedReader 的含义?如果我们转到SymbolHound并使用搜索字符串 clojure ^ ,我们将返回:






找到 clojure ^ 的结果$ p



还有更多答案。


Clojure uses a number of special characters such as

  • ^String
  • #(xyz ...)
  • %&
  • #_(some form here)
  • >!

and many more. How can I search for documentation for these special characters, given that Google et al mostly ignore special characters in web pages and search strings?

解决方案

This question and others have raised an important topic: it can often be difficult and frustrating to find documentation on special characters used in Clojure source code.

The first place to look is the Clojure docs themselves. There is even a special page devoted to this topic:

Many of the special characters are known as Reader Literals, which also have a documentation page:

You can also find hints regarding special chars & their usage on:

Finally, the search engine SymbolHound.com can search for special symbols that Google & others ignore. For example, consider this Clojure code:

(defn lines
  "Given an open reader, return a lazy sequence of lines"
  [^java.io.BufferedReader reader]
  (take-while identity (repeatedly #(.readLine reader))))

How could we search for the meaning of ^java.io.BufferedReader on the 3rd line? If we go to SymbolHound and use the search string clojure ^ we get back:


270 results found for clojure ^

and many more answers.

这篇关于如何在Clojure中搜索特殊字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆