简体   繁体   English

列出计划的理解库?

[英]List Comprehension Library for Scheme?

I know there is a list-comprehension library for common lisp ( incf-cl ), I know they're supported natively in various other functional (and some non-functional) languages (F#, Erlang, Haskell and C#) - is there a list comprehension library for Scheme? 我知道有一个通用的Lispincf-cl )的列表理解库,我知道它们在其他各种功能(和某些非功能性)语言(F#,Erlang,Haskell和C#)中得到了本机支持。列出计划的理解库?

incf-cl is implemented in CL as a library using macros - shouldn't it be possible to use the same techniques to create one for Scheme? incf-cl在CL中使用宏作为库来实现-是否可以使用相同的技术为Scheme创建一个技术?

  • Swindle is primarily a CLOS emulator library, but it has list comprehensions too. Swindle主要是一个CLOS模拟器库,但是它也具有列表理解功能。 I've used them, they're convenient, but the version I used was buggy and incomplete. 我使用了它们,它们很方便,但是我使用的版本有错误且不完整。 (I just needed generic functions.) (我只需要通用函数。)
  • However, you probably want SRFI-42 . 但是,您可能需要SRFI-42 I haven't used it, but it HAS to have fewer bugs than the Swindle list comprehensions. 我没有使用过它,但是它的错误少于Swindle列表理解的错误。

I don't know which Scheme you use. 我不知道您使用哪种方案。 PLT Scheme bundles Swindle and SRFI-42. PLT Scheme捆绑了Swindle和SRFI-42。 Both are supposed to be cross-Scheme compatible, though. 不过,两者都应该是跨方案兼容的。

If you use PLT Scheme, here is SRFI-42's man page . 如果您使用PLT Scheme,这是SRFI-42的手册页 You say (require srfi/42) to get it. 您说(require srfi/42)来获取它。

您可以将LINQ用于R6RS方案 (尽管可以使其在“较旧”的实现下运行)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM