(define (foo x) body ...)
==>
SCM foo(int nr, SCM k, SCM x)
{
if (nr != 1) arity_error();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang rhombus/static/and_meta | |
import: | |
lib("racket/base.rkt") as rkt: | |
rename: | |
#{evt?} as is_evt | |
#{always-evt} as always_evt | |
#{alarm-evt} as alarm_evt | |
#{guard-evt} as guard_evt | |
#{handle-evt} as handle_evt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- racket/collects/json/main.rkt 2024-11-05 16:35:40 | |
+++ racket/collects/json/exp.rkt 2024-12-12 07:43:11 | |
@@ -65,12 +65,16 @@ | |
any)] ;; jsexpr? | |
)) | |
+(module* for-extension #f | |
+ (provide read-json*)) | |
+ | |
;; ----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang rhombus/static/and_meta | |
import: | |
lib("racket/base.rkt"): | |
only: #{bytes-convert} | |
#{bytes-open-converter} | |
#{object-name} | |
#{port-counts-lines?} | |
#{port-next-location} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
;; install in a kw-example collect | |
(require (for-syntax racket/base | |
racket/string | |
syntax/parse) | |
racket/format | |
syntax/parse/define) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require ffi/unsafe | |
ffi/unsafe/custodian | |
ffi/unsafe/define | |
ffi/unsafe/schedule | |
racket/struct) | |
(provide evdev-open | |
evdev-read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (poll-evt poll-thunk | |
#:interval [interval-thunk (const 1000)] | |
#:cleanup [cleanup-thunk void]) | |
(poll-guard-evt | |
(lambda (polling?) | |
(if polling? | |
(cond [(poll-thunk) => | |
(lambda (v) | |
(wrap-evt always-evt (const v)))] | |
[else never-evt]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax-parse-rule (with-env ([var val] ...) body ...+) | |
(call-with-env | |
(make-environment-variables | |
(~@ (string->bytes/locale var) | |
(string->bytes/locale val)) ...) | |
(λ () body ...))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
;; Works on Linux, doesn't work on Mac? More minimal version. | |
(require ffi/unsafe | |
ffi/unsafe/define) | |
(define-ffi-definer define-curl (ffi-lib "libcurl")) | |
(define CURL_GLOBAL_ALL #b11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
;; Works on Linux, doesn't work on Mac? | |
(require ffi/unsafe | |
ffi/unsafe/define) | |
(define-ffi-definer define-curl (ffi-lib "libcurl") | |
#:provide provide-protected) |
NewerOlder