From 0dfe5363501bc20e9030c08b13e4f74aaf1e81fc Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 26 Sep 2015 16:55:27 -0700 Subject: [PATCH] move metas inside core #lang module --- main-base.rkt | 5 +++-- test/test-meta.rkt | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 test/test-meta.rkt diff --git a/main-base.rkt b/main-base.rkt index ecd5a23..50188ba 100644 --- a/main-base.rkt +++ b/main-base.rkt @@ -45,10 +45,11 @@ (module inner pollen/doclang-raw DOC-RAW ; positional arg for doclang-raw that sets name of export. (require pollen/top pollen/world) - (provide #%top (all-defined-out) (all-from-out pollen/world)) + (require (submod ".." META-MOD)) + (provide (all-defined-out) #%top (all-from-out pollen/world (submod ".." META-MOD))) EXPR-WITHOUT-METAS (... ...)) - (require 'inner 'META-MOD) + (require 'inner) (define DOC (let* ([parser-mode-undefined? (procedure? inner:parser-mode)] ; if undefined, #%top makes it a procedure [parser-mode (if parser-mode-undefined? PARSER-MODE-ARG inner:parser-mode)] diff --git a/test/test-meta.rkt b/test/test-meta.rkt new file mode 100644 index 0000000..81fc633 --- /dev/null +++ b/test/test-meta.rkt @@ -0,0 +1,10 @@ +#lang racket + +;; check that a `define-meta` is immediately available +(module metatest pollen + (define-meta key "value") + (define val (hash-ref metas 'key)) + (provide val)) + +(require rackunit 'metatest) +(check-equal? val "value") \ No newline at end of file