From: Stefan Schmiedl Date: 2001-12-07T08:33:10+09:00 Subject: [ruby-talk:27767] Re: Package Naming Joel VanderWerf (2001-12-07 07:59): > Stefan Schmiedl wrote: > > > > just to throw in another point of view: > > we could do it the dylan way ... > > > > http://www.gwydiondylan.org/drm/drm_112.htm#MARKER-9-2016 > > > > I think, the basic idea there is that a library exports > > a set of symbols and the importing units can rename it > > according to their tastes and needs. > > Does the Dylan way do anything better than the following? > > require 'some-module' > MyClassName = SomeModule::SomeClass? > It's been quite a while, since I last used Dylan, so I just paste the example from the above website. define module graphics use dylan; create draw-line, erase-line, invert-line, skew-line, frame-rect, fill-rect, erase-rect, invert-rect; end module graphics; define module lines use dylan; use graphics, import: {draw-line, erase-line, invert-line, skew-line}; end module lines; define module rectangles use dylan; use graphics, prefix: "graphics$", exclude: {skew-line}; end module rectangles; define module dylan-gx use dylan, export: all; use graphics, rename: {skew-line => warp-line}, export: all; end module dylan-gx; The modules created by these module declarations would have access to bindings with the following names: graphics draw-line erase-line invert-line skew-line frame-rect fill-rect erase-rect invert-rect plus all the bindings in the Dylan module lines draw-line erase-line invert-line skew-line plus all the bindings in the Dylan module rectangles graphics$draw-line graphics$erase-line graphics$invert-line graphics$frame-rect graphics$fill-rect graphics$erase-rect graphics$invert-rect plus all the bindings in the Dylan module dylan-gx draw-line erase-line invert-line warp-line frame-rect fill-rect erase-rect invert-rect plus all the bindings in the Dylan module s. -- Stefan Schmiedl EDV-Beratung, Programmierung, Schulung Loreleystr. 5, 94315 Straubing, Germany Tel. (0 94 21) 74 01 06 Public Key: http://xss.de/stefan.public shhhh ... I can't hear my code!