!
Is it possible to construct such a function for
set-dispatch-macro-character that
#8) would be fully equivalent to )))))))) ?
;;; any number, not '8' olny, of course.
--
A
.
Aleksander Nabag�o wrote:
> !
>
> Is it possible to construct such a function for
> set-dispatch-macro-character that
> #8) would be fully equivalent to )))))))) ?
Will there be little +/- GUI widgets next to the 8 so I can click on
them until the left parens I want blinks?
That would be so cool!
kt
Aleksander Nabag�o wrote:
> Is it possible to construct such a function for
> set-dispatch-macro-character that
> #8) would be fully equivalent to )))))))) ?
You'd have to replace the macro function for #\(. However, the difficult
thing is, how to match the number against the recursion depth?
Matthias Buelow <···@incubus.de> writes:
> Aleksander Nabagło wrote:
>
>> Is it possible to construct such a function for
>> set-dispatch-macro-character that
>> #8) would be fully equivalent to )))))))) ?
>
> You'd have to replace the macro function for #\(. However, the difficult
> thing is, how to match the number against the recursion depth?
Sounds like a good job for a special variable.
(defvar *read-recusion-length* 0)
Not only will you rewrite the reader macro for #\(,
but also the dispatch reader macro for #\# #\(,
#\# #\A, #\# #\S, and perhaps some others I'm forgeting.
(a #( 1 2 #2A((a b) (c d #4)
And don't forget to update all the emacs mode that do paren matching
please.
--
__Pascal Bourguignon__
Pascal J. Bourguignon wrote:
> (defvar *read-recusion-length* 0)
However, the HyperSpec says: "The reader macro function must not have
any side effects other than on the input stream". Of course, one can
choose to ignore that...
!
Pascal J. Bourguignon napisa�(a):
> Sounds like a good job for a special variable.
>
> (defvar *read-recusion-length* 0)
>
> Not only will you rewrite the reader macro for #\(,
> but also the dispatch reader macro for #\# #\(,
> #\# #\A, #\# #\S, and perhaps some others I'm forgeting.
sssSS, it would be a havoc.
I have in mind pushing back the #\)'s,
#8) -> push source stream, push ))))))))#0)
when #\)'s consumed, #0) triggers restore
of the source stream; none modifications
to existing dispatch reader macros except #).
#) signals reader-error, ignoring num arg.
--
A
.
På Thu, 17 Jul 2008 14:29:53 +0200, skrev Aleksander Nabagło
<·@ap.krakow.pl>:
> !
>
> Is it possible to construct such a function for
> set-dispatch-macro-character that
> #8) would be fully equivalent to )))))))) ?
>
> ;;; any number, not '8' olny, of course.
>
Yes, you can make the reader do that, but why would you want to?
Normally you use the paren matching to check you have closed to the right
level.
Also the parens allow SLIME commands to manipulate the order of the sexp's
(Ctrl-Alt-t) which this would mess up.
A more common use is a reader macro to close the rest of the parens.
But there is a SLIME command for that (Ctrl-c-Ctrl-q) so spesific reader
syntax is rarely used anymore.
(On my Norwegian keyboard {[]·····@ are bound to AltGr which is the same
as Ctrl-Alt so none of the Ctrl-Alt command on these keys work..
For example slime-close-all-parens Ctrl-Alt-] is impossible to enter.)
--------------
John Thingstad
On Thu, 17 Jul 2008 08:03:25 -0700 (PDT), ········@gmail.com said:
| ...
| 'wise', this strange antiquated term, means those things which doesn't
| have real drawbacks in the long term;
They say that one who has information can make a mistake; one who
has knowledge can correct that mistake; and one who has wisdom can
avoid the mistake in the first place...
(They also say that one who has information can post to Usenet; one
who has knowledge can follow up to a post; and one who has wisdom
can refrain from following up...)
---Vassil.
--
Peius melius est. ---Ricardus Gabriel.
On Thu, 17 Jul 2008 14:29:53 +0200, Aleksander Nabag�o <·@ap.krakow.pl> said:
| Is it possible to construct such a function for
| set-dispatch-macro-character that
| #8) would be fully equivalent to )))))))) ?
By the way, `#)' is already taken and we _do_ want it to signal an
error, so any such exercise or variation on that theme would have to
choose a different character (or pair of character).
See also the literature about Interlisp, which had a broadly similar
facility called super-parentheses (a right bracket closed all
parentheses up to a left bracket), so such a thing has been
subjected to natural selection, in fact...
---Vassil.
--
Peius melius est. ---Ricardus Gabriel.
Vassil Nikolov <···············@pobox.com> writes:
> On Thu, 17 Jul 2008 14:29:53 +0200, Aleksander Nabag�o <·@ap.krakow.pl> said:
> | Is it possible to construct such a function for
> | set-dispatch-macro-character that
> | #8) would be fully equivalent to )))))))) ?
>
> By the way, `#)' is already taken and we _do_ want it to signal an
> error, so any such exercise or variation on that theme would have to
> choose a different character (or pair of character).
>
> See also the literature about Interlisp, which had a broadly similar
> facility called super-parentheses (a right bracket closed all
> parentheses up to a left bracket), so such a thing has been
> subjected to natural selection, in fact...
So what? Jurassic Parcs are fun!
--
__Pascal Bourguignon__ http://www.informatimago.com/
PLEASE NOTE: Some quantum physics theories suggest that when the
consumer is not directly observing this product, it may cease to
exist or will exist only in a vague and undetermined state.