Opened 5 years ago

Closed 5 years ago

#473 closed defect (fixed)

library declaration locations in top-level

Reported by: alexshinn Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:


R6RS allows only a single library declaration, import,
at the beginning of a program body, and this must
contain all imported libraries.

Pending the result of ticket #472 we may also allow
include(-ci) and cond-expand to expand into
imports, and so the single form restriction would not
make sense. However, it would be reasonable to
restrict all library declarations to the beginning of
a program - the first non-declaration would begin
the real body. This is the beginning-only option.

The advantage of the r6rs proposal is that it would
not require any changes in existing R6RS program
loading implementations to support. If the result of
ticket #472 indicates multiple declaration types are
available this option would automatically become
invalid, so you don't need to vote against it on those

The advantage of the beginning-only option is
that it becomes possible to statically determine
all program imports without expansion, which was
the primary motivation of a static library system.

The final alternative is any-top-level, which
allows these forms anywhere at the top-level,
possibly interspersed with definitions. The advantage
of this is that you can cut&paste repl sessions
(for which interspersed imports are always allowed)
as a program. The disadvantage is that programs
can no longer be resolved separately from expansion.

Change History (3)

comment:1 Changed 5 years ago by cowan

  • Status changed from new to decided

WG1 voted to adopt the beginning-only alternative. This means that programs (but not libraries or the REPL) must have all their import declarations appear at the beginning of the program.

comment:2 Changed 5 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

comment:3 Changed 5 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.