emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Modules, libraries, eggs, etc.


From: Lawrence Bottorff
Subject: [O] Modules, libraries, eggs, etc.
Date: Tue, 6 Sep 2016 15:17:28 -0400

Racket has a nice module system whereby a module is kept in a plain text .rkt file. For example,

#lang racket
(provide print-cake)
; draws a cake with n candles
(define (print-cake n)
  (show "   ~a   " n #\.)
  (show " .-~a-. " n #\|)
  (show " | ~a | " n #\space)
  (show "---~a---" n #\-))
 
(define (show fmt n ch)
  (printf fmt (make-string n ch))
  (newline))

is in cake.rkt so that

#+begin_src scheme :session ch2
(require "cake.rkt")
(print-cake (random 30))
#+end_src

produces the actual ascii -- albeit in the *Geiser dbg* buffer (or run from the associated REPL ch2):

; -*- geiser-scheme-implementation: racket -*-
(require "cake.rkt")
(print-cake (random 30))


=> #<void>

   .......................   
 .-|||||||||||||||||||||||-. 
 |                         | 
-----------------------------

So, this means I can do some Racket in org-mode, but the module side has to be outside. This seems not so elegant. Is there a babel language where the entire ecosystem is inside Emacs/org-mode? I'd like to have the module paradigm and have it all inside Emacs/org-mode.

LB

reply via email to

[Prev in Thread] Current Thread [Next in Thread]