Why does clojure convert dashes in names to underscores in the filesystem?

后端 未结 2 911
野的像风
野的像风 2020-12-07 00:20

I have been using clojure for a couple of months now and one thing I really don\'t understand is why dashes in namespace names must be represented as underscores in the file

2条回答
  •  清歌不尽
    2020-12-07 01:12

    Do you mean that the .class files on disk have underscores where the functions in Clojure had dashes? I'm sure I read that it's something to do with the JVM not supporting dashes in those file names. (Or at least it not being a guarantee that it supports them.)

    This is only a limitation of the class file names, and Clojure silently deals with this problem anyway. Your own code can still handle files with dashes in the filename.

    I'm sorry that I don't have a reference for this right now.

提交回复
热议问题