Simple Tic-Tac-Toe game developed with heavy use of design-by-contract
A Pen by Jack Firth on CodePen.
Simple Tic-Tac-Toe game developed with heavy use of design-by-contract
A Pen by Jack Firth on CodePen.
A package catalog is something that maps package names to package metadata which must include a package source. This decouples the name of a package from where it's source is located, allowing package authors to declare dependencies on names instead of sources and to relocate the source of their package without breaking the dependency specifications of client packages.
Package metadata must include a checksum, but other than that no keys are required for a
properly operating package catalog. However many tools (particularly raco pkg
) use certain
Racket is a language with a small community and a big space of things you can do. This means there's a lot of incredibly useful libraries and tools that nobody's had the time to make. This gist is a catalog of things I'd like to see made, maybe with the eventual goal of figuring out a way to coordinate with other community members in getting some of them done.
predicate/c
. Here are some possibilities:
(list-repeating/c number? boolean? string?)
- describes lists like (1 #t "foo")
and (1 #t "foo" 2 #f "bar")
(operation-> string?)
- describes functions like string-append
that take any number of string?
s and returns a string?
. (no idea what to name)(rest-> string? number?)
- All arguments are string?
s, result is number?
. (no idea what to name)xrepl
when developing outside DrRacket. Set to automatically start up whenever racket is run at command line.racket-mode
for emacs development#lang envy
for environment variable configuration#lang debug
for "printf debugging"#lang sweet-exp
for prettifying requires and provides, or other simple pieces of code where parens are just noise (can be partially used in a file, doesn't need to apply to the whole file)#lang reprovide
for modules that just require and provide other modules to group them together#lang racket/base
instead of #lang racket
for libraries, packages, and other re-usable pieces of code, to reduce dependencies-lib
packages of libraries for applications to reduce dependencies/private
subcollection to make any code depending on internals sti#! /usr/bin/env racket | |
#lang racket/base | |
(require racket/file | |
racket/function | |
racket/cmdline) | |
(define (add-path-to-bash-profile! #:path path-string | |
#:profile profile-path-string) |
Welcome to 12 Days of Racket Packages! The Racket Package Catalog contains 695 packages at the time of this writing (counting packages in the main distribution). That's a pretty big achievement for such a small community and a package system that's barely two years old. In hopes of helping users find great packages, we're publishing a series of 12 blog posts, once per day, starting today. Each post will detail a single package available in the catalog and describe what you might use it for and what's interesting about it. Extra attention may be paid to "Rackety" features, for instance packages providing a custom #lang. This series is in the spirit of and directly inspired by 24 Days of Hackage.
The flexpr
package (source) by Greg Hendershott is a simple package
@defproc[(specification [prop property?] [arb arbitrary?] ...) specification?]{ | |
Constructs a runnable, executable, testable @specification-tech[] that tests that | |
@racket[prop] holds for all inputs from the given @racket[arb]s. The returned | |
specification can be quickly tested with @racket[check-specification]. Additionally, | |
the specification can be run and have its results analyzed separately by using | |
@racket[run-specification]. | |
@quickcheck2-examples[ | |
(check-specification (specification positive? arbitrary-natural)) | |
(check-specification (specification even? arbitrary-natural)) | |
]} |
(define (zero-or-more term) | |
(one-of term | |
(sequence-of term (zero-or-more term)))) | |
(define nat-addition-grammar | |
(grammar [NUMBER (one-of DIGIT | |
(sequence-of NONZERO-DIGIT (zero-or-more DIGIT)))] | |
[DIGIT (one-of NONZERO-DIGIT | |
(literal 0))] | |
[NONZERO-DIGIT (one-of (literal 1) (literal 2) (literal 3) (literal 4) (literal 5) (literal 6) (literal 7) (literal 8) (literal 9))] |
What is the type of a value that promises the following: