Erik Naggum <e...@naggum.no> wrote: > If you edit code, anything that keeps all of ASCII from being > accessible without contortions is rabidly insane.
Hitting two or even three keys in sequence to get an operator from your favorite programming language isn't really *rabidly* insane. Hell, if it were, we'd all have to switch to Paul Graham's Arc, which seems to be based on that idea:-)
That said, the one place where I actually had to type the caret more than once in a blue moon was in Gnus, to move up the reference chain. I changed that keybinding, and that was it.
What isn't good thinking IMHO is for a language *designer* to reject a syntax that would be really nice just because he can't type it conveniently using his *current* setup. That'd be like specifying a fixed huffman tree for ZIP and expect people to adjust their compressible material accordingly.
-- Marcus Breiing mailto:news-gwif...@breiing.com (will expire)
Nils Goesche <car...@cartan.de> wrote: > $ setxkbmap -layout us
Well, I use Win2K as a device driver so that wouldn't work. However, on this system I can hit alt-shift to switch between German and US layout on the fly. Nifty.
I also do major-mode dependent remapping of ö,ä and ü, but that's about all the keyboard mangling I can stomach. I like to retain the ability to work on other people's computers. I have almost *lost* the ability to use non-RPN pocket calculators, and that bothers me, sometimes:-)
-- Marcus Breiing mailto:news-gwif...@breiing.com (will expire)
Erik Naggum <e...@naggum.no> writes: > On Norwegian keyboards, {}[] are reachable with AltGr and a digit key on > the left hand. If you write in any language using the C syntax template, > and you have /not/ changed to a US keyboard layout to get rid of this > monstrous insanity, you deserve the wrists you are soon going to get.
Marcus Breiing wrote: > Pascal Costanza <costa...@web.de> wrote:
>>Anything else? ;)
> Sure ;-)
> What do you think
> (prog@ > (let ((@ 2)) > @))
> should return (once you get rid of the macroexpansion-time errors)?
Oh dear! ;)
> Hey, when you're done with prog@, don't forget to abstract-out the > more interesting parts. Maybe call it WALKER?
I haven't exposed myself to tree walkers yet - could you or someone give me pointer where to read about them?
Thanks, Pascal
-- Given any rule, however ‘fundamental’ or ‘necessary’ for science, there are always circumstances when it is advisable not only to ignore the rule, but to adopt its opposite. - Paul Feyerabend
Barry Margolin wrote: > One thing that bothers me about this macro: it looks like it doesn't nest > well. What does
> (prog@ > @ 'outer > (prog@ > @ 'inner))
> return? I think it *should* return OUTER, but I suspect it actually > returns INNER (I haven't tried it).
Kenny's recent post has already convinced me that I shouldn't traverse deeply into the forms but only do a shallow traversal. Your example is another good argument in that direction.
With a shallow traversal things get considerably simpler.
I like this more than other proposals with prog1/progn or (let ...) because there, the before and after parts are not at the same level. (This is only an aesthetical issue.)
I like Erik's proposal to use the $ sign for my macro. The ! might give Schemers a headache. ;)
I think a proper name that includes "return" (like prog-return) instead of a marker like ! or $ can be misleading because "return" usually means to return immediately.
About the consing of multiple-value-list: I guess a good solution for that would be to provide two versions, prog$ and multiple-value-prog$. (So the above macro would be the multiple-value-prog$ version.)
Thanks again for all the comments.
Pascal
-- Given any rule, however ‘fundamental’ or ‘necessary’ for science, there are always circumstances when it is advisable not only to ignore the rule, but to adopt its opposite. - Paul Feyerabend
Erik Naggum <e...@naggum.no> writes: > * Pascal Costanza > | I don't like ^ because it's usually inconvenient to type, and reminds me > | of the pointer symbol in Pascal.
> This is one case where it makes sense to think about something even > though it gives you painful associations.
> ^ is unshifted above the Y on my keyboard...
Hmm, Pascal has painful memories of Pascal ...
If you're looking for positive associations, SmallTalk writes (return foo) as ^foo and it's got this nice up-arrow feel to it
-- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'
Pascal Costanza <costa...@web.de> writes: > Marcus Breiing wrote: > > Hey, when you're done with prog@, don't forget to > > abstract-out the more interesting parts. Maybe call it > > WALKER?
> I haven't exposed myself to tree walkers yet - could you or > someone give me pointer where to read about them?
Heh -- I gave you those examples to help you understand that what you need is a fully-fledged code walker /if/ you really want to descend into the code to replace the occurrences of @. Just google for ``code walker´´ to find one, or do (apropos "walk") because many Lisp implementations already contain one. However, all the PROG* forms return simply one of their ``top-level´´ forms -- if you do the same, your macro would be much easier to write -- just don't descend into the code.
Regards, -- Nils Gösche Ask not for whom the <CONTROL-G> tolls.
The whole trigram concept was invented by a particularly dishonest Danish nutjob who did not want to change his keyboard. Now, C sports bigrams, one of his ideas that would have been shot down if anybody had bothered to check his claim that "X, Y, and Z used it", which he successfully used to fool at least 4 different standardization organizations by arguing that the others used it and running around fast enough to ensure that that argument was self-sustaining, however circular. It was an amazing example of how it is possible to use the implicit trust in decisions made standardization organizations can be exploited. Even the IETF was used in this political game and published a horribly bug-ridden RFC that is /completely/ worthless.
-- Erik Naggum, Oslo, Norway
Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.
Nils Goesche wrote: > Pascal Costanza <costa...@web.de> writes:
>>Marcus Breiing wrote:
>>>Hey, when you're done with prog@, don't forget to >>>abstract-out the more interesting parts. Maybe call it >>>WALKER?
>>I haven't exposed myself to tree walkers yet - could you or >>someone give me pointer where to read about them?
> Heh -- I gave you those examples to help you understand that what > you need is a fully-fledged code walker /if/ you really want to > descend into the code to replace the occurrences of @. Just > google for ``code walker´´ to find one, or do (apropos "walk") > because many Lisp implementations already contain one.
Of course - sorry!
Pascal
-- Given any rule, however ‘fundamental’ or ‘necessary’ for science, there are always circumstances when it is advisable not only to ignore the rule, but to adopt its opposite. - Paul Feyerabend
> >>>Hey, when you're done with prog@, don't forget to > >>>abstract-out the more interesting parts. Maybe call it > >>>WALKER?
> >>I haven't exposed myself to tree walkers yet - could you or > >>someone give me pointer where to read about them? > > Heh -- I gave you those examples to help you understand that what > > you need is a fully-fledged code walker /if/ you really want to > > descend into the code to replace the occurrences of @. Just > > google for ``code walker´´ to find one, or do (apropos "walk") > > because many Lisp implementations already contain one.
> Of course - sorry!
Wieso sorry? Nur falls Du es nicht weiszt, ``Heh´´ ist Englisch fuer ``Hehe´´, nicht ``Hey!´´ :-)
Bis denne, -- Nils Gösche Ask not for whom the <CONTROL-G> tolls.
* Nils Goesche | Pardon my ignorance, but google didn't help much in this case. | What are trigrams?
A way for really stupid people to write C without changing to a rational keyboard layout. I see now that they are actually called "trigraphs". In brief, the following replacements are made at a very early stage in the processing of the input files.
Erik Naggum <e...@naggum.no> writes: > * Nils Goesche > | Pardon my ignorance, but google didn't help much in this case. > | What are trigrams?
> A way for really stupid people to write C without changing to > a rational keyboard layout. I see now that they are actually > called "trigraphs".
Ah, sure. I know these, of course. Just one of the many things the experienced C programmer gets bitten by once in a while... :-( I don't remember a specific example, but I am certain that there was more than one occasion I or a coworker got bitten by this -- made for very hard to find bugs (always end your exciting debug messages and comments with ?!, not with ??).
I have indeed been wondering all the time how something stupid like this could ever enter the C standard. Do you know the story? Is it written down somewhere?
Regards, -- Nils Gösche Ask not for whom the <CONTROL-G> tolls.
* Nils Goesche <n...@cartan.de> | I have indeed been wondering all the time how something stupid like this | could ever enter the C standard. Do you know the story? Is it written | down somewhere?
I just told the story.
-- Erik Naggum, Oslo, Norway
Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.
"Wade Humeniuk" <w...@nospam.nowhere> writes: > The prog-anywhere can be renamed to anything one wants. I am > not sure how a VALUES return could be made to work. Also the > flet could be replaced with a macrolet if one is concerned > with generating anonymous functions all over the place.
Here's something along these lines that would allow multiple values:
Erik Naggum <e...@naggum.no> writes: > * Nils Goesche <n...@cartan.de> > | I have indeed been wondering all the time how something > | stupid like this could ever enter the C standard. Do you > | know the story? Is it written down somewhere?
> I just told the story.
Yes, but I still don't know the name of the dane in question :-) -- Nils Gösche Ask not for whom the <CONTROL-G> tolls.
Nice touch with the returner-name. I get that mind altered feeling with the example. It feels like it would be useful in real life (a kind of a space connected with a whole bunch of wormholes), though I am don't know where. Adds a new take on the idea of spaghetti code.
Gabe Garza wrote: > "Wade Humeniuk" <w...@nospam.nowhere> writes:
>>The prog-anywhere can be renamed to anything one wants. I am >>not sure how a VALUES return could be made to work. Also the >>flet could be replaced with a macrolet if one is concerned >>with generating anonymous functions all over the place.
> Here's something along these lines that would allow multiple > values:
To be able to deal with multiple values is especially important when you want to call a (predefined) function that returns multiple values.
Another question: I have seen (gensym "SOME-NAME") every now and then. My understanding of this usage of gensym is that the generated symbols aren't strictly unique anymore, right? Why do people still use this idiom?
Pascal
-- Given any rule, however ‘fundamental’ or ‘necessary’ for science, there are always circumstances when it is advisable not only to ignore the rule, but to adopt its opposite. - Paul Feyerabend
> Another question: I have seen (gensym "SOME-NAME") every now and > then. My understanding of this usage of gensym is that the generated > symbols aren't strictly unique anymore, right? Why do people still use > this idiom?
The generated symbols are unique--that's the whole point of gensym. I assume you're confused over giving it a name...
In this case, I used it for ease of debugging. Any worthy Common Lisp environment will have a facility for macroexpanding a form so you can see what your macros are expanding to. For example, in ilisp if I put the cursor before the previous example and type M-x macroexpand-lisp the following output is displayed:
> Another question: I have seen (gensym "SOME-NAME") every now and > then. My understanding of this usage of gensym is that the generated > symbols aren't strictly unique anymore, right? Why do people still use > this idiom?
The generated symbols are unique--that's the whole point of gensym. I assume you're confused over giving it a name...
In this case, I used it for ease of debugging. Any worthy Common Lisp environment will have a facility for macroexpanding a form so you can see what your macros are expanding to. For example, in ilisp if I put the cursor before the previous example and type M-x macroexpand-lisp the following output is displayed:
Gabe Garza wrote: > Pascal Costanza <costa...@web.de> writes:
>>Another question: I have seen (gensym "SOME-NAME") every now and >>then. My understanding of this usage of gensym is that the generated >>symbols aren't strictly unique anymore, right? Why do people still use >>this idiom?
> The generated symbols are unique--that's the whole point of gensym. I > assume you're confused over giving it a name...
No, it's about the uniqueness. In the example you have given, it may be the case that RETURN-VALUES-LIST2158 has already existed before. As far as I understand the HyperSpec a Common Lisp implementation is not required to take the necessary precautions against this case (whereas (gensym) without a string argument is always guaranteed to be unique). Right?
-- Given any rule, however ‘fundamental’ or ‘necessary’ for science, there are always circumstances when it is advisable not only to ignore the rule, but to adopt its opposite. - Paul Feyerabend
> >>Another question: I have seen (gensym "SOME-NAME") every now and > >>then. My understanding of this usage of gensym is that the generated > >>symbols aren't strictly unique anymore, right? Why do people still use > >>this idiom? > > The generated symbols are unique--that's the whole point of gensym. > > I > > assume you're confused over giving it a name...
> No, it's about the uniqueness. In the example you have given, it may > be the case that RETURN-VALUES-LIST2158 has already existed before. As > far as I understand the HyperSpec a Common Lisp implementation is not > required to take the necessary precautions against this case (whereas > (gensym) without a string argument is always guaranteed to be > unique). Right?
Wrong.
A symbol with the name RETURN-VALUES-LIST2158 may already have existed; however, it is a different symbol from the one returned by gensym. The CLHS page on gensym makes this clear, when it says that the return value is a "fresh, uninterned symbol".