Alan Manuel Gloria: > ,op is (unquote op) is (unquote . (op . ())) Unless I'm mistaken, (op > . ()) is not eqv? to another (op . ())
Yes, indeed. I was about to post that correction to myself. > Adding a non-standard function we have to define ourselves to the > specifications of curly-infix looks bad to me. Yeah, that is a problem. > Since equal? could mount a DoS, maybe we shouldn't support anything > other than stuff that can be trivially compared eq? It's hard to imagine what else would be usefully compared other than symbols (which we already allow using eq?) and pairs (which normally compare as non-eq?). > > Anyone screaming in horror? > > Me, now that I brought it up. LOL. :-). > Sufficiently modern Scheme hardly uses quasiquotation anymore anyway; > even quasisyntax unsyntaxing #,op is rare, as most sufficiently modern > macros are done using syntax-rules, and only rarely using syntax-case. > So maybe it's not such a big deal.... in Scheme. > > It's different for CL though, as it is impossible to usefully add > pattern-matching macros to the standard without serious reanimation of > the dead and similar necromancy. Random small Lisplikes are also much > more likely to use quasiquotation in macros rather than > pattern-matching. Although equal is easy to invoke, I think the DoS attack is devastating and we should not use "equal?". Since users can invoke the operations by using prefix, e.g., (,op arg1 arg2 ...), it's not that they cannot express the alternative, so the importance of supporting it goes down. The use case ",op" is interesting, but we need to find a really easy rule that doesn't allow easy DoS. I don't know of any way of doing that *other* than defining a new comparison function, since eq?, eqv?, and equal? all don't do this. The comparison function could be limited to only doing eqv? (or eq?) of the car's, and just recursing the cdr, but I don't think that helps all that much. BTW, the R7RS draft makes equal? guarantee to terminate. Which makes equal? suddenly a *very* expensive operation. Sigh. Is there some reason that the spec writers have to reuse the same names but use the semantics? What would be the harm in creating a new symbol when you radically change the semantics, so that people could write portable programs? The spec description could be something like: "eqop? is a bounded equal? that terminates if given circular data structures, but only guarantees to compare 16 different objects." Or something like that. I can't see how to make that much simpler, and it's certainly more complicated than just replacing "eq?" with "equal?" in the spec. --- David A. Wheeler ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss