当前位置: 动力学知识库 > 问答 > 编程问答 >

Racket Source and / or Cookbook Examples

问题描述:

How much of Racket is written in Racket? For example, is the argmax function implemented in Racket or in C? What about take and drop? I couldn't find it in the source on github.

The reason I ask is that as a Scheme / Racket newbie it would be very useful to try and grok the source of as much elegant Racket code as I could, to get a handle on functional / recursive best practices. Of course, if everything is mostly implemented in C then this isn't the right direction for me.

Alternatively, is there a "cookbook" or "examples" page somewhere online showing how to recreate many of the built-ins in Racket, similar to "my-map" and "my-length"?

Thanks.

网友答案:

You can download the racket source yourself from Github. There is enough racket code there to be worthwhile, but I prefer looking at the modules for such "cookbook" examples.

PLaneT is a good resource for other people's code as well.

网友答案:

A whole lot of the Racket libraries are written in the language itself, but it is overwhelming to try to wade through the entire source to find and study the functions you're interested in. If you work through the text How to Design Programs ( http://htdp.org and http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html ), written by the authors of Racket, you will in the process learn and understand how to write the functions you have asked about (implementation of the functions take, drop, map, length, and similar are directly addressed about one-third to one-half of the way through the textbook).

分享给朋友:
您可能感兴趣的文章:
随机阅读: