【问题标题】:Why are consecutive spaces in the result of an evaluated expression collapsed in Light Table?为什么计算表达式的结果中的连续空格在 Light Table 中折叠?
【发布时间】:2016-07-27 21:53:09
【问题描述】:

Light Table 似乎折叠了多个连续的空格。

Expected behavior: (str "hello   " "there") => "hello   there"
Actual behavior:   (str "hello   " "there") => "hello there"

【问题讨论】:

  • 我无法重现您的结果。
  • @Sam Estep:您的示例在输入中有一个空格。在输入中使用多个空格,您可以重现问题。
  • 我在源代码中确实有多个空格用于我的评论,但是这个站点上的 Markdown 渲染器会折叠空格,所以我编辑了那个部分。当我将呼叫文本从您的问题复制到 str 并将其粘贴到 lein replboot repl 时,我会得到您作为“预期行为”提供的输出。
  • 好的,那这一定是Light Table的bug。向 OP 添加了屏幕截图。
  • 是的,我刚刚在 Light Table 中尝试过,得到了相同的结果。看起来有人在 Light Table Google 群组中有 already posted。我编辑了您的问题,以澄清它更多的是关于 Light Table 而不是 Clojure。

标签: lighttable


【解决方案1】:

我认为这“只是”与 light table 的基于 HTML 的平台相关的显示问题。您可以通过评估这些表达式来确认这一点:

(= "hello     there" (str "hello     " "there")) ; true
(= "hello there"     (str "hello     " "there")) ; false 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-04
    • 1970-01-01
    • 1970-01-01
    • 2020-04-10
    • 1970-01-01
    相关资源
    最近更新 更多