On 5/10/06, Alessandro Manotti <[EMAIL PROTECTED]> wrote:
>
> Ok, in this way I preserve the original code, but the problem is I
> need to implement a new dialect to to be used in batch (like in a
> program) but I need to use it in "live", from command console.
>
> It means if I create a standard dialect it could become really annoing
> use it. E.g.:
>
> >> mydialect [ myCommand ]
>
> You can see I need to type many things. Since I'm creating something
> like a dos-shell, I need to creating fast typing commands.
>
> Look at another example:
>
> DOS SHELL:
> >> copy file1 file2
>
> MY FUTURE SHELL:
> >> mydialect [ copy file1 file2 ]
>
> I typed too many things!
> Another way could be creating new commands with a prefix (but I don't
> like this solution):
>
> >>jcopy file1 file2
>

Since the context for the console and the context for rebols internals
is the same, overriding is tricky.

Some ideas:

- Implement an own console. That is basically
dos: func[][
  forever[set/any 'res do bind (load/all ask ">>") my-overrides
attempt[probe res]]
]
Disadvantage: The real console can deal with multi-line-input, this
simple version not.
Cyphre has a quite complete console written for view, IIRC it can do that.

- Use both a short and a long name, keep the middle ones for rebol.
 cp: copy-file: func["cp copy-file: copies a file" .. ][..]
both are unlikely to clash, the long name is easier to find with 'help
and then you see the short version. And you can use the long name in
files, where precision is more important than keysaving.
Add a function 'help-dos, then you can type "help hel", that gives
'help, 'help-dos etc.

..snip..

--=20
-Volker

"Any problem in computer science can be solved with another layer of
indirection. But that usually will create another problem." David
Wheeler
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to