Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts on Racket. # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/racket.e> # or at <http://angg.twu.net/e/racket.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # «.debian» (to "debian") # «.drracket» (to "drracket") # «.racket-git» (to "racket-git") # «.drracket-git» (to "drracket-git") # # «.geiser» (to "geiser") # «.racket-mode» (to "racket-mode") # «.racket-repl» (to "racket-repl") # «.scribble-mode» (to "scribble-mode") # # «.circle» (to "circle") # «.class» (to "class") # «.init-file» (to "init-file") # «.lang» (to "lang") # «.lang-slideshow» (to "lang-slideshow") # «.latex-pict» (to "latex-pict") # «.pict» (to "pict") # «.plot» (to "plot") # «.raco» (to "raco") # «.sdraw» (to "sdraw") # «.sicp-pict» (to "sicp-pict") # «.xrepl» (to "xrepl") https://en.wikipedia.org/wiki/Racket_(programming_language) https://racket-lang.org/ ##### # # debian # 2022nov30 # ##### # «debian» (to ".debian") # (find-zsh "installeddebs | sort | grep racket") # (find-zsh "availabledebs | sort | grep racket") # (find-status "racket-doc") # (find-vldifile "racket-doc.list") # (find-udfile "racket-doc/") # (find-status "racket-common") # (find-vldifile "racket-common.list") # (find-udfile "racket-common/") # (find-status "racket") # (find-vldifile "racket.list") # (find-udfile "racket/") # (find-udfile "racket/quick/") # (find-udfile "racket/quick/quick.scrbl") # (find-udfile "racket/quick/quick.scrbl" "scribblings/more") # (find-udfile "racket/algol60/") # (find-racketdoc "index") # (find-racketdoc "quick/index") # (find-racketdoc "getting-started/index") # (find-racketdoc "racket-cheat/index") # (find-racketdoc "guide/index") ##### # # Dr Racket # 2025jan05 # ##### # «drracket» (to ".drracket") # (find-sh "apt-file search drracket") # (find-racketfile "pkgs/drracket-tool-lib/drracket/") # (find-racketdoc "drracket/index") # (find-racketdocw "drracket/index") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) apt-file search drracket | tee /tmp/o for i in $(awk '{print $2}' /tmp/o); do dirname $i; done | tee /tmp/od cat /tmp/od | sort | uniq # (find-fline "/usr/share/doc/racket/drracket/") # (find-fline "/usr/share/doc/racket/drracket-tools/") # (find-fline "/usr/share/doc/racket/tools/") # (find-fline "/usr/share/racket/pkgs/drracket/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/drracket/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/drracket/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/drracket/private/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/drracket/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/drscheme/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/drscheme/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/lang/") # (find-fline "/usr/share/racket/pkgs/drracket-plugin-lib/lang/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-tool/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-doc/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-doc/scribblings/drracket-tools/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-doc/scribblings/drracket-tools/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/drracket/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/drracket/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/drracket/private/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/drracket/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/drracket/private/syncheck/") # (find-fline "/usr/share/racket/pkgs/drracket-tool-lib/drracket/private/syncheck/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/browser/") # (find-fline "/usr/share/racket/pkgs/drracket/browser/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/browser/private/") # (find-fline "/usr/share/racket/pkgs/drracket/browser/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/drracket/") # (find-fline "/usr/share/racket/pkgs/drracket/drracket/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/drracket/private/") # (find-fline "/usr/share/racket/pkgs/drracket/drracket/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/drracket/private/syncheck/") # (find-fline "/usr/share/racket/pkgs/drracket/drracket/private/syncheck/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/drscheme/") # (find-fline "/usr/share/racket/pkgs/drracket/drscheme/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/drscheme/private/") # (find-fline "/usr/share/racket/pkgs/drracket/drscheme/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/gui-debugger/") # (find-fline "/usr/share/racket/pkgs/drracket/gui-debugger/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/gui-debugger/icons/") # (find-fline "/usr/share/racket/pkgs/drracket/help/") # (find-fline "/usr/share/racket/pkgs/drracket/help/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/help/private/") # (find-fline "/usr/share/racket/pkgs/drracket/help/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/macro-debugger/") # (find-fline "/usr/share/racket/pkgs/drracket/macro-debugger/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/repo-time-stamp/") # (find-fline "/usr/share/racket/pkgs/drracket/repo-time-stamp/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/scribble/tools/") # (find-fline "/usr/share/racket/pkgs/drracket/scribble/tools/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/scribble/tools/private/") # (find-fline "/usr/share/racket/pkgs/drracket/scribble/tools/private/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/scribblings/drracket/") # (find-fline "/usr/share/racket/pkgs/drracket/scribblings/drracket/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/scribblings/tools/") # (find-fline "/usr/share/racket/pkgs/drracket/scribblings/tools/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/setup/") # (find-fline "/usr/share/racket/pkgs/drracket/setup/compiled/") # (find-fline "/usr/share/racket/pkgs/drracket/version/") # (find-fline "/usr/share/racket/pkgs/drracket/version/compiled/") # (find-fline "/usr/share/racket/pkgs/htdp-lib/stepper/") # (find-fline "/usr/share/racket/pkgs/htdp-lib/stepper/compiled/") # (find-fline "/usr/share/racket/pkgs/rackunit-gui/rackunit/private/gui/") # (find-fline "/usr/share/racket/pkgs/rackunit-gui/rackunit/private/gui/compiled/") ##### # # Racket from git # 2022nov30 # ##### # «racket-git» (to ".racket-git") # (find-git-links "https://github.com/racket/racket.git" "racketgit") # (code-c-d "racketgit" "~/usrc/racket/") # (code-c-d "racketgitscbrl" "~/usrc/racket/pkgs/racket-doc/scribblings/") # (find-racketgitfile "") # (find-racketgitsh "find * | sort") # (find-racketgitsh "find * | sort | grep rkt") # (find-racketgitsh "find * | sort | grep drracket") # (find-racketgitsh "du -c") # (find-racketgitfile "") # (find-racketgitfile "pkgs/racket-doc/ffi/examples/") # (find-racketgitfile "pkgs/racket-doc/scribblings/") # (find-racketgitfile "pkgs/racket-doc/scribblings/guide/module-syntax.scrbl") # (find-racketdocr "guide/module-syntax" "hash-lang") # (find-racketdoc "guide/Module_Syntax#%28part._hash-lang%29") ##### # # drracket-git # 2025jan05 # ##### # «drracket-git» (to ".drracket-git") # https://github.com/racket/drracket # (find-git-links "https://github.com/racket/drracket" "drracket") # (code-c-d "drracket" "~/usrc/drracket/") # (find-drracketfile "") ##### # # racket-mode # 2022nov30 # ##### # «racket-mode» (to ".racket-mode") # (to "racket-repl") # (to "geiser") # (find-angg ".emacs" "racket") # https://www.racket-mode.com/#Architecture # https://news.ycombinator.com/item?id=8345828 Racket mode for GNU Emacs (github.com/greghendershott) # https://news.ycombinator.com/item?id=8346029 geiser supports images in a racket repl inside emacs # https://github.com/greghendershott/racket-mode # (code-c-d "racketmode" "~/usrc/racket-mode/" "racket-mode") # (find-racketmodefile "") # (find-racketmodegrep "grep --color=auto -niRH --null -e image *") # (find-epackage-links 'racket-mode "racketmode" t) # (find-epackage 'racket-mode) # (code-c-d "racketmode" "~/.emacs.d/elpa/racket-mode-20250103.1921/" "racket-mode") # (find-racketmodefile "") # (find-racketmodenode "") # (find-racketmodenode "Edit buffers and REPL buffers") # (find-racketmodenode "Minimal Racket" "drracket") # (find-racketmodenode "Configure") # (find-racketmodenode "Commands") # (find-racketmodenode "Hash Langs") # (find-racketmodenode "Explore") # (find-racketmodenode "racket-documentation-search") # (find-racketmodenode "Run") # (find-racketmodenode "racket-debug-mode") # (find-racketmodenode "Eval") # (find-racketmodenode "racket-images-inline") # (find-racketmodegrep "grep --color=auto -nH --null -e racket-images *.el") # (find-racketmodegrep "grep --color=auto -niH --null -e image *.el") # (find-racketmodegrep "grep --color=auto -niRH --null -e image *") # (find-racketmodefile "racket-repl.el" ";;; Inline images in REPL") # (find-racketmodefile "racket-repl.el" "(defun racket-repl-describe ") ##### # # racket-repl # 2025jan05 # ##### # «racket-repl» (to ".racket-repl") # (find-angg ".emacs" "eepitch-racketrepl") # (find-eapropos "racket-repl") # (find-efunctiondescr 'racket-repl-mode) # (find-efunction 'racket-repl-mode) # (find-efunctiondescr 'racket-repl) # (find-efunction 'racket-repl) # (find-efunctiondescr 'with-racket-repl-buffer) # (find-efunction 'with-racket-repl-buffer) # (find-racketmodenode "racket-run-module-at-point" "C-c C-c") # (find-efunction 'racket-repl) # (find-racketmodefile "racket-repl.el" " run %s ") (find-dbsw-call '(racket-repl)) (defun find-racketreplbuffer () (find-dbsw-call '(racket-repl))) (defun eepitch-racketrepl () (eepitch '(find-racketreplbuffer))) * (eepitch-racketrepl) * (eepitch-kill) * (eepitch-racketrepl) (find-racketreplbuffer) ##### # # scribble-mode # 2025jan05 # ##### # «scribble-mode» (to ".scribble-mode") # (find-epackage-links 'scribble-mode "scribblemode" t) # (find-epackages 'scribble-mode) # (find-epackage 'scribble-mode) # (code-c-d "scribblemode" "~/.emacs.d/elpa/scribble-mode-20190912.200/") # (find-scribblemodefile "") # (find-racketgitfile "pkgs/racket-doc/syntax/scribblings/") # https://news.ycombinator.com/item?id=32865098 Scribble: The Racket Documentation Tool # (find-racketdoc "scribble/manual") ##### # # raco # 2022nov30 # ##### # «raco» (to ".raco") # (find-man "raco") # (find-sh "raco help") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) raco pkg help raco pkg show raco pkg show sicp raco pkg install sicp raco pkg catalog-show latex-pict raco pkg delete latex-pict raco pkg show sicp raco pkg install sicp raco help raco docs # (find-man "raco") # (find-racketlocalfile "") # (find-racketlocalsh "find *") # (find-racketlocalsh "find * | sort") # (find-racketlocalfile "pkgs/sicp/") # (find-racketlocalfile "pkgs/sicp/sicp/") # (find-racketlocalfile "pkgs/sicp/sicp-doc/") # (find-racketlocalfile "pkgs/sicp/sicp-doc/doc/sicp-manual/") # (find-racketlocalfile "pkgs/sicp/sicp-pict/") # (find-racketlocalfile "pkgs/sicp/sicp-pict/main.rkt") ##### # # sdraw # 2024oct19 # ##### # «sdraw» (to ".sdraw") # (find-racketdoc "sdraw/index") # (find-racketdoc "draw/index") # https://docs.racket-lang.org/sdraw/index.html # https://docs.racket-lang.org/pict/index.html ##### # # sicp-pict # 2022nov30 # ##### # «sicp-pict» (to ".sicp-pict") # https://docs.racket-lang.org/sicp-manual/SICP_Picture_Language.html # https://github.com/sicp-lang/sicp/blob/master/sicp-pict/main.rkt * (eepitch-racket) * (eepitch-kill) * (eepitch-racket) #lang racket (require sicp-pict) (paint (number->painter 0)) (paint diagonal-shading) (paint (below (beside diagonal-shading (rotate90 diagonal-shading)) (beside (rotate270 diagonal-shading) (rotate180 diagonal-shading)))) (paint einstein) # file:///usr/share/doc/racket/index.html # file:///usr/share/doc/racket/pkg/getting-started.html#%28part._installing-packages%29 https://docs.racket-lang.org/sicp-manual/index.html https://docs.racket-lang.org/sicp-manual/Installation.html Resolving "sicp" via https://download.racket-lang.org/releases/7.9/catalog/ Resolving "sicp" via https://pkgs.racket-lang.org Downloading repository https://github.com/sicp-lang/sicp.git raco setup: version: 7.9 raco setup: platform: x86_64-linux [3m] raco setup: target machine: racket raco setup: installation name: 7.9 raco setup: variants: 3m raco setup: main collects: /usr/share/racket/collects raco setup: collects paths: raco setup: /home/edrx/.local/share/racket/7.9/collects raco setup: /usr/share/racket/collects raco setup: main pkgs: /usr/share/racket/pkgs raco setup: pkgs paths: raco setup: /usr/share/racket/pkgs raco setup: /home/edrx/.local/share/racket/7.9/pkgs raco setup: links files: raco setup: /usr/share/racket/links.rktd raco setup: /home/edrx/.local/share/racket/7.9/links.rktd raco setup: main docs: /usr/share/doc/racket raco setup: --- updating info-domain tables --- [22:24:37] raco setup: updating: /home/edrx/.local/share/racket/7.9/share/info-cache.rktd raco setup: --- pre-installing collections --- [22:24:37] raco setup: --- installing foreign libraries --- [22:24:37] raco setup: --- installing shared files --- [22:24:37] raco setup: --- compiling collections --- [22:24:37] raco setup: --- parallel build using 2 jobs --- [22:24:37] raco setup: 1 making: <pkgs>/sicp/sicp raco setup: 1 making: <pkgs>/sicp/sicp/lang raco setup: 0 making: <pkgs>/sicp/sicp-doc raco setup: 1 making: <pkgs>/sicp/sicp/test raco setup: 1 making: <pkgs>/sicp/sicp-pict raco setup: 1 making: <pkgs>/sicp/sicp-pict/test raco setup: --- creating launchers --- [22:24:44] raco setup: --- installing man pages --- [22:24:44] raco setup: --- building documentation --- [22:24:44] raco setup: 0 running: <pkgs>/racket-index/scribblings/main/user/local-redirect.scrbl raco setup: 1 running: <pkgs>/racket-index/scribblings/main/user/release.scrbl raco setup: 0 running: <pkgs>/racket-index/scribblings/main/user/search.scrbl raco setup: 0 running: <pkgs>/sicp/sicp-doc/sicp-manual.scrbl raco setup: 1 running: <pkgs>/racket-index/scribblings/main/user/start.scrbl raco setup: 1 rendering: <pkgs>/racket-index/scribblings/main/user/local-redirect.scrbl raco setup: 0 rendering: <pkgs>/racket-index/scribblings/main/user/release.scrbl raco setup: 1 rendering: <pkgs>/racket-index/scribblings/main/user/search.scrbl raco setup: 1 rendering: <pkgs>/sicp/sicp-doc/sicp-manual.scrbl raco setup: 0 rendering: <pkgs>/racket-index/scribblings/main/user/start.scrbl raco setup: --- installing collections --- [22:25:10] raco setup: --- post-installing collections --- [22:25:10] https://stackoverflow.com/questions/39886804/how-to-run-picture-language-examples-of-sicp-scheme-in-repl ##### # # xrepl # 2025jan05 # ##### # «xrepl» (to ".xrepl") # (find-racketfile "pkgs/xrepl-lib/xrepl/xrepl.rkt") # (find-fline "~/LOGS/2025jan05.racket" "xrepl") # (find-racket-links "xrepl") # (find-racketdoc "xrepl/index#%28part._top%29") # (find-racketdoc "xrepl/index") * (eepitch-racket) * (eepitch-kill) * (eepitch-racket) (require xrepl) (require pict) ,describe circle ,describe pict ,describe describe ##### # # geiser # 2022dec29 # ##### # «geiser» (to ".geiser") # (to "racket-mode") # https://news.ycombinator.com/item?id=8346029 geiser supports images in a racket repl inside emacs # (find-epackages 'geiser) # (find-epackage-links 'geiser) # (find-epackage-links 'geiser-racket) # (find-epackage 'geiser) # (find-epackage-links 'geiser "geiser" t) # (find-epackage 'geiser) # (code-c-d "geiser" "~/.emacs.d/elpa/geiser-20221225.2214/") # (find-geiserfile "") # (find-epackage-links 'geiser-racket "geiserracket" t) # (find-epackage 'geiser-racket) # (code-c-d "geiserracket" "~/.emacs.d/elpa/geiser-racket-20210421.125/") # (find-geiserracketfile "") ##### # # circle # 2025jan05 # ##### # «circle» (to ".circle") # (to "pict") * (eepitch-racketrepl) * (eepitch-kill) * (eepitch-racketrepl) (require pict) (circle 20 #:border-color "red") ##### # # class # 2025jan05 # ##### # «class» (to ".class") # (find-racketdoc "reference/mzlib_class") # (find-racketdoc "reference/createclass") * (eepitch-racket) * (eepitch-kill) * (eepitch-racket) (define (describe obj) (printf "Hello ~a\n" obj)) (define table% (class object% (define/public (describe-self) (describe this)) (super-new))) (send (new table%) describe-self) Hello #(struct:object:table% ...) ##### # # init-file # 2025jan05 # ##### # «init-file» (to ".init-file") # (find-man "1 racket") # (find-sh "racket --help") # (find-sh "racket --help" "Start-up sequence:") # (find-angg ".racketrc") ##### # # lang # 2025jan05 # ##### # «lang» (to ".lang") # (find-racketdoc "guide/Module_Syntax#%28part._hash-lang%29") # (find-racketdocw "guide/Module_Syntax#%28part._hash-lang%29") # (find-racketdocr "guide/module-syntax" "hash-lang") ##### # # lang-slideshow # 2025jan05 # ##### # «lang-slideshow» (to ".lang-slideshow") # (find-sh "locate racket | grep slideshow") # (find-sh "locate racket | grep slideshow | grep rkt") # (find-racketfile "pkgs/" "slideshow") ##### # # latex-pict # 2025jan09 # ##### # «latex-pict» (to ".latex-pict") # (find-racket-links "latex-pict") # https://github.com/soegaard/latex-pict.git # (find-git-links "https://github.com/soegaard/latex-pict" "latexpict") # (code-c-d "latexpict" "~/usrc/latex-pict/") # (find-latexpictfile "") ##### # # pict # 2025jan05 # ##### # «pict» (to ".pict") # (to "circle") # (find-racketdoc "quick/index") # (find-racketfile "pkgs/slideshow-doc/scribblings/quick/quick.scrbl") # (find-racketdoc "pict/index") # (find-racketdoc "pict/Animation_Helpers") # (find-racketdoc "pict/Tree_Layout") # (find-sh "locate racket | grep /pict/") # (find-racketfile "pkgs/" "pict-lib") # (find-racketfile "pkgs/pict-lib/pict/") # (find-racketfile "pkgs/pict-lib/pict/private/utils.rkt" "(define (circle size") # (find-racket-links "pict") * (eepitch-racket) * (eepitch-kill) * (eepitch-racket) (circle 10) (require pict) (circle 10) * (eepitch-racketrepl) * (eepitch-kill) * (eepitch-racketrepl) (require pict) (circle 10 #:border-color "red") (rectangle 10 20 #:border-color "red") (circle 10 20) ; err * (define c (circle 10 #:border-color "red")) (define r (rectangle 10 20 #:border-color "red")) r (hc-append c r) (hc-append 20 c r c) * (define (square n) (filled-rectangle n n #:border-color "red")) * (square 10) * (define (four p) (define two-p (hc-append p p)) (vc-append two-p two-p)) (four (circle 10 #:border-color "red")) * (define (checker p1 p2) (let ([p12 (hc-append p1 p2)] [p21 (hc-append p2 p1)]) (vc-append p12 p21))) (checker (colorize (square 10) "red") (colorize (square 10) "black")) * (define (checkerboard p) (let* ([rp (colorize p "red")] [bp (colorize p "black")] [c (checker rp bp)] [c4 (four c)]) (four c4))) (checkerboard (square 10)) * (define (mycircle size) (circle size #:border-color "red")) (mycircle 50) * (define (series mk) (hc-append 4 (mk 5) (mk 10) (mk 20))) (series mycircle) (series square) * (series (lambda (size) (checkerboard (square size)))) * (define series (lambda (mk) (hc-append 4 (mk 5) (mk 10) (mk 20)))) (series (lambda (size) (checkerboard (square size)))) * (define (rgb-series mk) (vc-append (series (lambda (sz) (colorize (mk sz) "red"))) (series (lambda (sz) (colorize (mk sz) "green"))) (series (lambda (sz) (colorize (mk sz) "blue"))))) (rgb-series circle) (rgb-series square) * (define (rgb-maker mk) (lambda (sz) (vc-append (colorize (mk sz) "red") (colorize (mk sz) "green") (colorize (mk sz) "blue")))) (series (rgb-maker circle)) (series (rgb-maker square)) * (list "red" "green" "blue") (list (mycircle 10) (square 10)) * (define (rainbow p) (map (lambda (color) (colorize p color)) (list "red" "orange" "yellow" "green" "blue" "purple"))) (rainbow (square 5)) * (apply vc-append (rainbow (square 5))) * ** (require pict/flash) ** (filled-flash 40 30 #:color "red") * (require slideshow/code) (code (circle 10)) * (define-syntax pict+code (syntax-rules () [(pict+code expr) (hc-append 10 expr (code expr))])) (pict+code (circle 10 #:border-color "red")) * (require racket/class racket/gui/base) (define f (new frame% [label "My Art"] [width 300] [height 300] [alignment '(center center)]))] (send f show #t) @(mr-interaction-eval (send f show #f)) The @racket[new] form creates an instance of a class, where initialization arguments like @racket[label] and @racket[width] are provided by name. The @racket[send] form calls a method of the object, such as @racket[show], with arguments after the method name; the argument @racket[#t] in this case is the boolean constant ``true.'' Pictures generated with @racketmodname[slideshow] encapsulate a function that uses the graphics toolbox's drawing commands to render the picture to a drawing context, such as a canvas in a frame. The @racket[make-pict-drawer] function from @racketmodname[slideshow] exposes a picture's drawing function. We can use @racket[make-pict-drawer] in a canvas-painting callback to draw a picture into a canvas: @(mr-interaction-eval (require pict/flash)) @mr-def+int[ (define (add-drawing p) (let ([drawer (make-pict-drawer p)]) (new canvas% [parent f] [style '(border)] [paint-callback (lambda (self dc) (drawer dc 0 0))]))) (add-drawing (pict+code (circle 10))) (add-drawing (colorize (filled-flash 50 30) "yellow")) ] @centerline{ @(mr-interaction-eval-show (scale (bitmap (build-path (collection-path "scribblings/quick") "art.png")) 0.5))} Each canvas stretches to fill an equal portion of the frame, because that's how a frame manages its children by default. ##### # # plot # 2022dec15 # ##### # «plot» (to ".plot") # (find-racketdoc "plot/index") # https://lists.gnu.org/archive/html/emacs-orgmode/2022-12/msg00479.html (require 2htdp/image) # (find-efunction 'geiser-repl-mode) (save-window-excursion (geiser 'racket)) # (find-sh "racket --help") # (find-man "racket") (defun find-racketrepl () (interactive) (find-wottb-call "\\`\\*Racket REPL" bufname &rest pos-spec-list) ;; (find-eev "eev-blinks.el" "find-wottb") (racket-repl-buffer-name) (find-dbsw-call '(racket-repl)) # (find-node "(racket-mode)Top") # (find-fline "~/LOGS/2022nov30.racket" "geiser-repl-import-module") # (find-es "scheme" "racket") # https://racket-lang.org/ https://news.ycombinator.com/item?id=32478808 Certifying Interpreters in Racket (kmicinski.com) https://kmicinski.com/certifying-interpreters - racket * https://docs.racket-lang.org/draw/index.html # (find-sh "locate racket/doc/quick") (code-c-d "racketlocal" "~/.local/share/racket/7.9/") # (find-racketlocalfile "") # (find-racketlocalsh "find * | sort") # (find-racketlocalfile "pkgs/sicp/sicp-pict/") https://github.com/avelino/awesome-racket https://github.com/jackfirth/lens https://github.com/jeapostrophe/pict3d https://docs.racket-lang.org/teachpack/2htdpimage-guide.html # (find-sh "locate 2htdp") # https://www.nongnu.org/geiser/ # https://www.reddit.com/r/emacs/comments/7zc1so/scheme_geiser_and_emacs/ https://soegaard.github.io/blog/metapict/ https://soegaard.github.io/blog/2013/06/27/drawing-bezier-curves/ https://soegaard.github.io/blog/2013/06/21/summer-project-meta-font-post-in-racket/ https://nullprogram.com/blog/2023/01/18/ u-config: a new, lean pkg-config clone https://easylang.online/ https://easylang.online/easyprogramming/ https://rdivyanshu.github.io/hat.html https://news.ycombinator.com/item?id=37621151 Drawing hat tiling using Racket (rdivyanshu.github.io) https://gist.github.com/vindarel/c1ef5e043773921e3b11d8f4fe1ca7ac Common Lisp VS Racket - testimonies.md https://docs.racket-lang.org/pollen/ https://news.ycombinator.com/item?id=41963491 Pollen: A publishing system written in Racket (racket-lang.org) # (find-racketgitfile "racket/src/ChezScheme/unicode/UNIDATA/emoji-data.txt") # Local Variables: # coding: utf-8-unix # End: