emacs / elisp:什么是哈希(磅,数字符号,octothorp)符号用于? [英] emacs/elisp: What is the hash (pound, number sign, octothorp) symbol used for?

查看:114
本文介绍了emacs / elisp:什么是哈希(磅,数字符号,octothorp)符号用于?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是做什么的?

 (add-hook'compilation-mode-hook#'my-setup-compile-mode)

...与...不同

 (add-hook'compilation-mode-hook'my-setup-compile-mode)


解决方案

没有区别:

 (eq'my-add#我的添加)

产生 t p>

可以在 lambda前面使用表达式向字节编译器指示以下表达式可以被字节编译,请参阅匿名函数。但是,在一个符号的情况下,没有什么可以编译。



一般来说,它被用在打印的表示以及左角括号(<),表示打印的对象是描述(但不能读)。例如:

 #< buffer foo.txt> 

读者也在构造中使用它来表示圆形结构。请参阅阅读循环对象语法的文档



然后,您可以用它来表示 base for integers ,eg #x2c - > 44



加上更多我确定。


What does this do?

(add-hook 'compilation-mode-hook #'my-setup-compile-mode)

...and is it different than

(add-hook 'compilation-mode-hook 'my-setup-compile-mode)

解决方案

There is no difference:

(eq 'my-add #'my-add)

yields t

The # can be used in front of a lambda expression indicating to the byte-compiler that the following expression can be byte compiled, see the docs for Anonymous Functions. But there's nothing to compile in the case of a symbol.

In general, it is used in the printed representation along with the left angle bracket (<) to indicate that the object printed is a description (but cannot be read). For example:

#<buffer foo.txt>

It is also used in constructs by the reader to represent circular structures. See the docs for Read Syntax for Circular Objects.

And then you have its use for denoting the base for integers, e.g. #x2c -> 44.

Plus more I'm sure.

这篇关于emacs / elisp:什么是哈希(磅,数字符号,octothorp)符号用于?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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