English 中文(简体)
如何检查文号是T?
原标题:How to check if symbol is T?

我正在做一些文本处理,其中一部分是把言词分为单一性质。 每一种特性都作为顶级的象征而相互交织,其频率价值只是为了方便而分配给它,但正如人们可能想象的那样,以T恒定的形式存在一个 st脚石。

我现在研究的解决办法是简单地使用低地文号而不是上下级案例T,然而,我很想知道,能否迅速和容易地核实目前的文号是T。

我可以认为:

(intern (if (string= "T" (symbol-name symbol)) # symbol)

但是,仅仅看不到一点,因为严格比较并不麻烦。 任何想法?

PS. I need all the symbols in upper case since it is less hassle to evaluate them in listener but I can live with one lowercase t.

最佳回答

页: 1 www.un.org/Depts/DGACM/index_french.htm

CL-USER> (shadow  t)
COMMON-LISP:T
CL-USER> (let ((t 17)) t)
17

影子固定<代码>T仍可称为cl:t

问题回答

You should use a hash table instead of hacking the current package into an ad-hoc one. It sidesteps the T issue entirely, and is a far cleaner solution.

如果割礼是令人关切的问题,你可以行使如下职能:(defun频率(char)(gethash char the-table)>,即使在主要法典体中,也应当使用这一功能,因为除了缩短外,这意味着你的代码是用“品格”而不是“在一片海桌上研究价值”写成的。

如果你重新审视最终确定最低生活水平的关键,那么你可以确定一个更新的宏观,例如:

(set-macro-character #?
                     (lambda (stream char)
                       (declare (ignore char))
                       (let ((char (read stream)))
                         `(frequency (character  ,char))))
                     t)

我猜测你可能无法完全理解,但你可以检查编号A的频率,如<代码>? A。

任何途径,都是为了写成能够简单地、细致地实现其目标的法典,使之与良好风格和“最佳实践”相一致,因为如果你想要某种特殊目的,如不太平坦的参加,那么你就能够总是在另一个抽象的层次上 p。





相关问题
Lisp code called from Java

Long story: I am doing a project for my functional programing class, and I thought of writing an AI controller in Lisp, for the Mario AI competition. I was looking over frameworks/libraries/ways of ...

Emacs, Zen-Coding mode, and Putty

I use emacs via Putty and since Putty doesn t send certain key combinations to the remote console I generally need to re-bind them to other key combinations. After installing the amazing Zen-Coding ...

In Which Cases Is Better To Use Clojure? [closed]

I develop in Lisp and in Scheme, but I was reading about Clojure and then I want to know, in which cases is better to use it than using Lisp or Scheme? Thanks

lambda-gtk negative pointer

I was trying to write my own put-pixel on (Gdk) pixbuf in Lisp. When I finally realized how I can operate on C pointers in CL, new obstacle came along - (gdk:pixbuf-get-pixels pb) returns me negative ...

Is there a common lisp package naming convention?

I have created some of my own user packages and have run into a name clash. In Java, the naming convention is to use your domain name in the package name: e.g. import com.example.somepackage;. Are ...

SOAP request from within an AutoLISP/AutoCAD macro

We have built a webservice for a client that uses AutoCAD. They have a macro that runs in AutoCAD that builds a SOAP request. But they have not figured out how to actually send() the soap request to ...

热门标签