[racket-users] splicing syntax surprise

2017-02-09 Thread Dan Liebgold
Hi all -

So, this is a simplified version of something we ran into: 
http://pasterack.org/pastes/70121

It was surprising that thing0 in the output template for read-thing was put in 
a list. Is this a feature of the splicing syntax?  Is there an automatic 
attribute that doesn't put it in a list (so the result would be '(foo bar))?

Thanks,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to attach all modules required by the current module to a namespace and then namespace-require them

2017-02-09 Thread Erich Rast
Thanks a lot, I think I'm getting closer to it but can't get this to
work with dynamic-require. So I've switched to sandbox, and still the
imported modules from the current module are just not available in the
sandboxed module:

(require racket/gui/base
 racket/sandbox
 racket/runtime-path
 gregor
 (prefix-in internat: "../core/internat.rkt")
 (prefix-in pref: "../core/prefs.rkt")
 (prefix-in db: "../core/dbaccess.rkt")
 (prefix-in dates: "../core/dates.rkt")
 (prefix-in metafonts: "../core/metafonts.rkt")
 (prefix-in threaded: "../core/threaded.rkt")
 (prefix-in console: "console.rkt"))
   ;   "../notetaker/notetaker-main.rkt")

(define-runtime-path notetaker
  "../notetaker/notetaker-main.rkt")

(define-namespace-anchor a)

(define notes-panel%
  (call-with-trusted-sandbox-configuration
   (lambda ()
 (let* ([ns (namespace-anchor->namespace a)]
[path-index (variable-reference->module-path-index
(#%variable-reference))]
[dbaccess (module-path-index-join  "../core/dbaccess.rkt"
path-index)])
 
   (parameterize ([sandbox-namespace-specs (list (lambda () ns)
(module-path-index-resolve dbaccess))])
 (let ([evaluator (make-module-evaluator notetaker)])
   (evaluator 'notes-panel%)))

When I run it, it says that some binding from dbaccess.rkt is not
available in the sandboxed module. But I'm adding it in the
sandbox-namespace-specs list. With dynamic-require I got essentially
the same result with manually attaching it and then calling
namespace-require.

Why does this not work?

Best,

Erich



On Thu, 9 Feb 2017 06:00:19 -0700
Matthew Flatt  wrote:

> A variable reference produced by `(#%variable-reference)` can serve as
> the starting point for reflective operations on modules. Specifically,
> use
> 
>  (variable-reference->module-path-index (#%variable-reference))
> 
> to get a reference to the enclosing module, and use
> `module-path-index-join` on that value and "../core/internat.rkt"
> to get a reference to the "../core/internat.rkt" module.
> 
> At Thu, 9 Feb 2017 12:25:35 +, Erich Rast wrote:
> > Out of general curiosity I'm still trying to figure out how a
> > dynamic plugin system would work. So now I'd like to
> > namespace-attach-module for all modules that the current module
> > imports (and their submodules), and then namespace-require them.
> > 
> > The problem is that I don't know how to attach modules required by
> > relative paths and with prefix-in, because I don't know their
> > symbolic name (if they have one). What I'm attempting is this:
> > 
> > (require racket/gui/base
> >  racket/runtime-path
> >  gregor
> >  (prefix-in internat: "../core/internat.rkt"))
> > 
> > (define-runtime-path notetaker
> >  "../notetaker/notetaker-main.rkt")
> > 
> > 
> > (define notes-panel%
> >   (let ([ns (make-base-empty-namespace)])
> > (namespace-attach-module (current-namespace)
> >  'racket/gui/base
> >  ns)
> > (namespace-attach-module (current-namespace)
> >  'gregor
> >  ns)
> > (namespace-attach-module (current-namespace)
> >  "../core/internat.rkt"
> >  ns)
> > (parameterize ([current-namespace ns])
> >   (namespace-require 'racket/gui/base)
> >   (namespace-require 'gregor)
> >   (namespace-require  "../core/internat.rkt")
> >   (dynamic-require notetaker 'notes-panel%
> > 
> > where the respective require for internat is left out in
> > notetaker-main.rkt, since the dynamically required module needs the
> > instance of the module *from the calling module's namespace*, not a
> > separate copy. But this fails for "internat.rkt" - and it also will
> > not create the right module path in the compiled distribution
> > binary, it seems.
> > 
> > Is there an internal symbolic name for the module required with
> > prefix-in and relative path?
> > 
> > Best,
> > 
> > Erich
> > 
> > -- 
> > You received this message because you are subscribed to the Google
> > Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.  

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to attach all modules required by the current module to a namespace and then namespace-require them

2017-02-09 Thread Matthew Flatt
A variable reference produced by `(#%variable-reference)` can serve as
the starting point for reflective operations on modules. Specifically,
use

 (variable-reference->module-path-index (#%variable-reference))

to get a reference to the enclosing module, and use
`module-path-index-join` on that value and "../core/internat.rkt"
to get a reference to the "../core/internat.rkt" module.

At Thu, 9 Feb 2017 12:25:35 +, Erich Rast wrote:
> Out of general curiosity I'm still trying to figure out how a dynamic
> plugin system would work. So now I'd like to namespace-attach-module
> for all modules that the current module imports (and their submodules),
> and then namespace-require them.
> 
> The problem is that I don't know how to attach modules required by
> relative paths and with prefix-in, because I don't know their symbolic
> name (if they have one). What I'm attempting is this:
> 
> (require racket/gui/base
>  racket/runtime-path
>  gregor
>  (prefix-in internat: "../core/internat.rkt"))
> 
> (define-runtime-path notetaker
>  "../notetaker/notetaker-main.rkt")
> 
> 
> (define notes-panel%
>   (let ([ns (make-base-empty-namespace)])
> (namespace-attach-module (current-namespace)
>  'racket/gui/base
>  ns)
> (namespace-attach-module (current-namespace)
>  'gregor
>  ns)
> (namespace-attach-module (current-namespace)
>  "../core/internat.rkt"
>  ns)
> (parameterize ([current-namespace ns])
>   (namespace-require 'racket/gui/base)
>   (namespace-require 'gregor)
>   (namespace-require  "../core/internat.rkt")
>   (dynamic-require notetaker 'notes-panel%
> 
> where the respective require for internat is left out in
> notetaker-main.rkt, since the dynamically required module needs the
> instance of the module *from the calling module's namespace*, not a
> separate copy. But this fails for "internat.rkt" - and it also will not
> create the right module path in the compiled distribution binary, it
> seems.
> 
> Is there an internal symbolic name for the module required with
> prefix-in and relative path?
> 
> Best,
> 
> Erich
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] 1st CfP: SLE 2017 (10th ACM SIGPLAN International Conference on Software Language Engineering)

2017-02-09 Thread Andrei Chis
===

**Call for Papers**

10th ACM SIGPLAN International Conference on Software Language Engineering (SLE 
2017)

23-24 October 2017, Vancouver, Canada

(Co-located with SPLASH 2017)

General chair:

   Benoit Combemale, University of Rennes 1, France

Program co-chairs:

   Marjan Mernik, University of Maribor, Slovenia
   Bernhard Rumpe, RWTH Aachen University, Germany

Artifact evaluation chairs

   Tanja Mayerhofer, TU Wien, Austria
   Laurence Tratt, King's College London, UK

http://conf.researchr.org/track/sle-2017/sle-2017-papers
http://www.sleconf.org/2017
Follow us on twitter: https://twitter.com/sleconf

===

Software Language Engineering (SLE) is the application of systematic, 
disciplined, and measurable approaches to the development, use, deployment, and 
maintenance of software languages. The term "software language" is used 
broadly, and includes: general-purpose programming languages; domain-specific 
languages (e.g. BPMN, Simulink, Modelica); modeling and metamodeling languages 
(e.g. SysML and UML); data models and ontologies (e.g. XML-based and OWL-based 
languages and vocabularies).

### Important Dates

Fri 2 Jun 2017 - Abstract Submission
Fri 9 Jun 2017 - Paper Submission
Fri 4 Aug 2017 - Author Notification
Thu 10 Aug 2017 - Artifact Submission
Fri 1 Sep 2017 - Artifact Notification
Fri 8 Sep 2017 - Camera Ready Deadline
Sun 22 Oct - SLE workshops
Mon 23 Oct - Tue 24 Oct 2017 - SLE Conference

### Topics of Interest

SLE aims to be broad-minded and inclusive about relevance and scope. We solicit 
high-quality contributions in areas ranging from theoretical and conceptual 
contributions to tools, techniques, and frameworks in the domain of language 
engineering. Topics relevant to SLE cover generic aspects of software languages 
development rather than aspects of engineering a specific language. In 
particular, SLE is interested in principled engineering approaches and 
techniques in the following areas:

* Language Design and Implementation
   * Approaches and methodologies for language design 
   * Static semantics (e.g., design rules, well-formedness constraints)
   * Techniques for behavioral / executable semantics
   * Generative approaches (incl. code synthesis, compilation)
   * Meta-languages, meta-tools, language workbenches

* Language Validation
   * Verification and formal methods for languages
   * Testing techniques for languages
   * Simulation techniques for languages

* Language Integration and Composition
   * Coordination of heterogeneous languages and tools
   * Mappings between languages (incl. transformation languages)
   * Traceability between languages
   * Deployment of languages to different platforms

* Language Maintenance
   * Software language reuse
   * Language evolution 
   * Language families and variability 

* Domain-specific approaches for any aspects of SLE (design, implementation, 
validation, maintenance)

* Empirical evaluation and experience reports of language engineering tools
   * User studies evaluating usability 
   * Performance benchmarks
   * Industrial applications

### Types of Submissions

* **Research papers**: These should report a substantial research contribution 
to SLE or successful application of SLE techniques or both. Full paper 
submissions must not exceed 12 pages including bibliography in ACM SIGPLAN 
conference style (http://www.sigplan.org/Resources/Author/).

* **Tool papers**: Because of SLE's interest in tools, we seek papers that 
present software tools related to the field of SLE. Selection criteria include 
originality of the tool, its innovative aspects, and relevance to SLE. Any of 
the SLE topics of interest are appropriate areas for tool demonstrations. 
Submissions must provide a tool description of 4 pages including bibliography 
in ACM SIGPLAN conference style (http://www.sigplan.org/Resources/Author/), and 
a demonstration outline including screenshots of up to 6 pages. Tool 
demonstrations must have the keywords “Tool Demo” or “Tool Demonstration” in 
the title. The 4-page tool description will, if the demonstration is accepted, 
be published in the proceedings. The 6-page demonstration outline will be used 
by the program committee only for evaluating the submission.

* **Industrial papers**: These should describe real-world application scenarios 
of SLE in industry, explained in their context with an analysis of the 
challenges that were overcome and the lessons which the audience can learn from 
this experience. Industry paper submissions must not exceed 6 pages including 
bibliography in ACM SIGPLAN conference style 
(http://www.sigplan.org/Resources/Author/).

* **New ideas / vision papers**: New ideas papers should describe new, 
non-conventional SLE research approaches that depart from standard practice. 
They are intended to describe well-defined research ideas 

[racket-users] How to attach all modules required by the current module to a namespace and then namespace-require them

2017-02-09 Thread Erich Rast
Out of general curiosity I'm still trying to figure out how a dynamic
plugin system would work. So now I'd like to namespace-attach-module
for all modules that the current module imports (and their submodules),
and then namespace-require them.

The problem is that I don't know how to attach modules required by
relative paths and with prefix-in, because I don't know their symbolic
name (if they have one). What I'm attempting is this:

(require racket/gui/base
 racket/runtime-path
 gregor
 (prefix-in internat: "../core/internat.rkt"))

(define-runtime-path notetaker
 "../notetaker/notetaker-main.rkt")


(define notes-panel%
  (let ([ns (make-base-empty-namespace)])
(namespace-attach-module (current-namespace)
 'racket/gui/base
 ns)
(namespace-attach-module (current-namespace)
 'gregor
 ns)
(namespace-attach-module (current-namespace)
 "../core/internat.rkt"
 ns)
(parameterize ([current-namespace ns])
  (namespace-require 'racket/gui/base)
  (namespace-require 'gregor)
  (namespace-require  "../core/internat.rkt")
  (dynamic-require notetaker 'notes-panel%

where the respective require for internat is left out in
notetaker-main.rkt, since the dynamically required module needs the
instance of the module *from the calling module's namespace*, not a
separate copy. But this fails for "internat.rkt" - and it also will not
create the right module path in the compiled distribution binary, it
seems.

Is there an internal symbolic name for the module required with
prefix-in and relative path?

Best,

Erich

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.