Prev: Byte Magazine Cover on LISP, A Space Odyssey, Nietzsche
Next: [ANN] Call for Participation for 2010 Workshop on Scheme and Functional Programming
From: Pascal J. Bourguignon on 4 Aug 2010 06:27 Fren Zeee <frenzeee(a)gmail.com> writes: > On Aug 2, 5:31�pm, "Daniel (Youngwhan)" <breadn...(a)gmail.com> wrote: >> Hi, >> >> If there is curly brace, it is easy to navigate between them by M-C-f >> and M-C-b in c-mode. >> >> However, I cannot find a way to navigate in like curly brace when it >> comes to #ifdef, #else, and #endif. >> >> For example, if there is a code like this: >> >> #ifdef A_DEFINED >> (...100 lines) >> #else >> (... 500 lines) >> #endif >> >> , is there a easy way to move the cursor from #endif to #ifdef or >> #else and vice versa? >> >> Daniel > > You might get better luck posting in a C group also. > > I use #ifdef ... #endif often also to comment out blocks of code > during debugging. > > My question to CLISP/ELISP/scheme people is clisp is an implementation, not a language. There is a language named Common Lisp, abreviated as CL. Perhaps you mean that? > If there is a wrapper do nothing type function in elisp/clisp/scheme > which can have the same effect as commenting out. > > This is because I dont like to do comment-region/uncomment-region in > emacs. > > These three lispy languages dont seem to have comment block construct > like C ie /* and */ AFAIK, emacs lisp doesn't have any block comment feature, and I know no standard way to do block comment in r5rs scheme, but scheme implementation may provide the same as in Common Lisp, or with a different syntax. In Common Lisp you could try to use #| |#, but unfortunately, it is not like C /* and */: int a[]={ /* hello /* world */ 1,2}; // a contains {1,2}. (let ((a '( #| hello #| world |# 1 2))) a) is a syntactic error. You would have to write: (let ((a '( #| hello #| world |# |# 1 2))) a) --> (1 2) However, in Common Lisp, you could implement a reader macro with a behavior similar to C /* comments */. This is the reason why there is no point asking whether there is a feature X in CL. You can always add any feature to the language, thanks to its macros or reader macros, and metalinguistic abilities in general. -- __Pascal Bourguignon__ http://www.informatimago.com/ |