babel.org 3.4 KB

:noweb header argument expansion

:PROPERTIES: :ID: eb1f6498-5bd9-45e0-9c56-50717053e7 :END:

(message "expanded")

;; noweb-yes-start <> ;; noweb-yes-end

;; noweb-no-start <> ;; noweb-no-end

;; noweb-tangle-start <> ;; noweb-tangle-end

elisp forms in header arguments

:PROPERTIES: :ID: 22d67284-bf14-4cdc-8319-f4bd876829 :var: prop=(+ 2 2) :END:

prop

4

excessive id links on tangling

:PROPERTIES: :ID: ef06fd7f-012b-4fde-87a2-2ae91504ea :END:

no, don't give me an ID

(message "not to be tangled")

yes, I'd love an ID

:PROPERTIES: :ID: ae7b55ca-9ef2-4d30-bd48-da30e35fd0 :END:

(message "for tangling")

simple variable resolution

:PROPERTIES: :ID: f68821bc-7f49-4389-85b5-914791ee37 :END:

(list 1 2 3 4)

(length four)

4

multi-line header arguments

:PROPERTIES: :ID: b77c8857-6c76-4ea9-8a61-ddc2648d96 :END:

(map 'list #'list numbers letters)

1 a
2 b
3 c
4 d
5 e
6 f
7 g

simple named code block

:PROPERTIES: :ID: 0d82b52d-1bb9-4916-816b-2c67c8108d :END:

42

42
42

Pascal's Triangle -- export test

:PROPERTIES: :ID: 92518f2a-a46a-4205-a3ab-bcce1008a4 :END:

(defun pascals-triangle (n) (if (= n 0) (list (list 1)) (let* ((prev-triangle (pascals-triangle (- n 1))) (prev-row (car (reverse prev-triangle)))) (append prev-triangle (list (map 'list #'+ (append prev-row '(0)) (append '(0) prev-row)))))))

(pascals-triangle n)

calling code blocks from inside table

:PROPERTIES: :ID: 6d2ff4ce-4489-4e2a-9c65-e3f71f77d9 :END:

(sqrt n)

executing an lob call line

:PROPERTIES: :results: silent :ID: fab7e291-fde6-45fc-bf6e-a485b8bca2 :END:

parsing header arguments

:PROPERTIES: :ID: 7eb0dc6e-1c53-4275-88b3-b22f3113b9 :END:

the body

conflicting blocks on export

:PROPERTIES: :ID: 5daa4d03-e3ea-46b7-b093-62c1b7632d :END:

  • a
  • b
  • c

"code block results"

(reverse lst)