Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > Re: The Fundame...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 73 of 111 Topic 13038 of 13900
Post > Topic >>

Re: The Fundamental Confusion of Xah

by "joswig@[EMAIL PROTECTED] " <joswig@[EMAIL PROTECTED] Jul 16, 2008 at 05:07 PM

On 17 Jul., 00:46, "xah...@[EMAIL PROTECTED]
" <xah...@[EMAIL PROTECTED]
> wrote:
> Dear Rainer,
>
> You wrote: <<It's missing the core of the issue. code as data is not
>
> about syntax.  ... Lisp dialects usually (the Scheme standard is an
> exception) see parsing of s-expressions as a dynamic feature of the
> reader. This is both good and bad. ... >>
>
> When a language, such as Lisp or Mathematica, that deals with symbols,
> the 2 formulation about "code$B"N(Bdata" is equivalent, ok?

Don't know. I would agree that Mathematica (and a bunch of other
languages)
also sup****t the 'code is data' idea.

<drivel>

> Also, you may or may not be aware, that people are making XML into a
> general purpose language. i.e. a language with XML as syntax. (e.g.
> O:XML (http://www.o-xml.org/),
and to a lesser degree MathML and XML
> transformation language
(http://en.wikipedia.org/wiki/XML_transformation_language
> ))

Sure, I heard of XML. There are plenty attempts in XML to do that.

> About a tool that autoformat lisp code, you wrote: <<That's not just a
> problem of Common Lisp, that's a problem of Lisp in general.  ...
> There is no fixed syntax and a fixed programmed scanner/parser for
> that syntax in Lisp (exception: as I mentioned Scheme has a fixed
> syntax, though Scheme implementations ...  It's true for a certain
> class of comments. Mainly comments for ; and #| ... |#. You can
> program the reader to get those comments read, but I haven't seen this
> done for a long time.  You need to use comments that are part of the s-
> expressions.  Common Lisp allows do***entation strings in certain
> places. ...  >>
>
> So, you are implicitly admitting, one of my ciritism of lisp
> (http://xahlee.org/UnixResource_dir/writ/lisp_problems.html),
that
> the irregularities of lisp syntax (e.g. "; ") is a problem?

What 'problem'? It sounds dramatic as only Lisp has such a 'problem'.
The 'problem' just is that the reader by default
is throwing away comments introduced by semicolon and #| |# and that
the
pretty-printer also does not know about those comments.
As Lisp systems are currently used this and automatic formatting of
textual
code is mostly not needed.

It's a design choice. Other features (like a programmable reader)
were more im****tant than 'comments as data'. Most Lisp systems
ignore comments and don't read it. As I mentioned Common Lisp
has several places where comments and do***entation can be
used in the source as data. Those will not be lost after
reading or pretty-printing code.

Still I would agree that it is interesting to have one and to get
more practical experience if it is useful or not.

As I said, either solve the problem by

a) ignore the comment problem (why not?) and just write a code
formatter.
   Could be a start.

b) implement the fully general solution by modifying the reader
   to also return comments and their position

c) implement a different lexical analysis tool within Emacs which
   parses a version of Lisp syntax that is fixed and deals with
comments.
   Probably not that easy, but possible.

Anyway, a real good code formatting tool is not that easy to write.

> Further, practically speaking, today there's no tool to autoformat
> lisp code as i described in my criticism (see the link above for
> detail ). This is a practical need.

Not for me. I'm usually fine with semi-automatic indenting or with a
real structure editor.

Anyway, I have a Lisp system which already has code formatting (minus
the
problem with comments). I wasn't using the formatter much.


It looks like this - a ****ed up formatting of some function:


(defun test-function

 (arg1 arg2

 arg3

argument-with-longer-name)

 "this function is just a test"

 (setf argument-with-longer-name (* arg1 ; use this
first

  arg2 (sin arg3)))
 (* argument-with-longer-name argument-with-longer-name argument-with-
longer-name argument-with-lo\
nger-name))


Now the command  'M-x format code'   and  'M-x lowercase in region'
produces the following formatting:


(defun test-function (arg1 arg2 arg3 argument-with-longer-name)
  "this function is just a test"
  (setf argument-with-longer-name (* arg1 arg2 (sin arg3)))
  (* argument-with-longer-name
     argument-with-longer-name
     argument-with-longer-name
     argument-with-longer-name))


You can see that the 'comment as data' do***entation string still is
there,
but the semicolon comment has been lost.


<your drivel deleted>
 




 111 Posts in Topic:
The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-13 07:53:38 
some corrections Re: The Fundamental Problems of Lisp
Vassil Nikolov <vnikol  2008-07-13 12:31:07 
Re: some corrections Re: The Fundamental Problems of Lisp
rpw3@[EMAIL PROTECTED] (  2008-07-13 20:36:01 
Re: some corrections Re: The Fundamental Problems of Lisp
Vassil Nikolov <vnikol  2008-07-13 23:04:14 
Re: some corrections Re: The Fundamental Problems of Lisp
pjb@[EMAIL PROTECTED] (P  2008-07-14 11:34:08 
Re: The Fundamental Problems of Lisp
Gene <gene.ressler@[EM  2008-07-13 10:14:46 
Re: The Fundamental Problems of Lisp
jon.harrop.ms.sharp@[EMAI  2008-07-13 11:09:53 
Re: The Fundamental Problems of Lisp
Evans Winner <thorne@[  2008-07-13 14:11:03 
Re: some corrections Re: The Fundamental Problems of Lisp
Paul Foley <see@[EMAIL  2008-07-15 01:51:18 
Re: The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-14 15:48:43 
Re: The Fundamental Problems of Lisp
Matthias Buelow <mkb@[  2008-07-16 01:47:27 
Re: The Fundamental Problems of Lisp
"John Thingstad"  2008-07-15 21:04:13 
Re: The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-15 13:32:50 
Re: The Fundamental Problems of Lisp
Christophe <christophe  2008-07-15 14:03:37 
Re: The Fundamental Problems of Lisp
Christophe <christophe  2008-07-15 14:09:01 
Re: The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-15 17:01:17 
The Fundamental Confusion of Xah
"joswig@[EMAIL PROTE  2008-07-15 19:13:22 
Re: The Fundamental Confusion of Xah
Evans Winner <thorne@[  2008-07-21 16:53:00 
Re: The Fundamental Confusion of Xah
Cor Gest <cor@[EMAIL P  2008-07-21 23:44:49 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-21 22:32:25 
Re: The Fundamental Confusion of Xah
Rainer Joswig <joswig@  2008-07-22 09:03:10 
Re: The Fundamental Confusion of Xah
"John Thingstad"  2008-07-22 09:49:45 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-22 07:16:27 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-22 16:43:20 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-22 13:38:23 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-22 22:51:17 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-25 23:57:14 
Re: The Fundamental Confusion of Xah
"xahlee@[EMAIL PROTE  2008-07-15 22:33:10 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-07-16 02:04:14 
Re: The Fundamental Problems of Lisp
Tamas K Papp <tkpapp@[  2008-07-16 09:30:32 
Re: The Fundamental Confusion of Xah
"joswig@[EMAIL PROTE  2008-07-16 04:43:03 
Re: The Fundamental Confusion of Xah
pjb@[EMAIL PROTECTED] (P  2008-07-16 17:02:33 
Re: The Fundamental Confusion of Xah
Rainer Joswig <joswig@  2008-07-16 17:29:58 
Re: The Fundamental Confusion of Xah
Vassil Nikolov <vnikol  2008-07-16 19:44:17 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-28 14:21:39 
Re: The Fundamental Confusion of Mr. Frog
Rainer Joswig <joswig@  2008-07-28 23:43:34 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-29 00:50:08 
Re: The Fundamental Confusion of Xah
parnell <parnell.flynn  2008-07-29 08:13:07 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-30 15:09:05 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-07-31 05:36:18 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-31 21:46:13 
Re: The Fundamental Confusion of Xah
Duane Rettig <duane@[E  2008-08-01 00:17:21 
Re: The Fundamental Confusion of Xah
Kenny <kentilton@[EMAI  2008-08-01 03:58:33 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-01 11:13:56 
Re: The Fundamental Confusion of Xah
Duane Rettig <duane@[E  2008-08-01 11:54:13 
Re: The Fundamental Confusion of Xah
"John Thingstad"  2008-08-01 10:14:19 
Re: The Fundamental Confusion of Xah
Pascal Costanza <pc@[E  2008-08-01 11:08:02 
Re: The Fundamental Confusion of Xah
"Dimiter \"malk  2008-08-04 16:58:40 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-07-31 05:40:29 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-31 21:49:53 
Re: The Fundamental Confusion of Xah
namekuseijin <namekuse  2008-07-31 13:23:50 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 01:43:46 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 01:55:15 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-01 11:22:32 
Re: The Fundamental Confusion of Xah
pjb@[EMAIL PROTECTED] (P  2008-08-01 14:26:18 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-01 18:50:11 
Re: The Fundamental Confusion of Xah
namekuseijin <namekuse  2008-08-01 09:16:45 
Re: The Fundamental Confusion of Xah
namekuseijin <namekuse  2008-08-01 09:23:07 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 12:14:50 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-02 06:06:25 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 12:23:26 
Re: The Fundamental Confusion of Xah
"Thomas F. Burdick&q  2008-08-02 03:17:27 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-02 07:32:34 
Re: The Fundamental Confusion of Xah
viper-2 <visionat@[EMA  2008-07-16 07:13:48 
Re: The Fundamental Confusion of Xah
Rainer Joswig <joswig@  2008-07-16 16:59:24 
Re: The Fundamental Confusion of Xah
viper-2 <visionat@[EMA  2008-07-16 09:56:08 
Re: The Fundamental Confusion of Xah
"xahlee@[EMAIL PROTE  2008-07-16 15:46:03 
Re: The Fundamental Confusion of Xah
Peter Keller <psilord@  2008-07-17 00:13:47 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-18 21:34:00 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-23 02:19:07 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-23 21:52:02 
Re: The Fundamental Confusion of Xah
viper-2 <visionat@[EMA  2008-07-16 16:54:19 
Re: The Fundamental Confusion of Xah
"joswig@[EMAIL PROTE  2008-07-16 17:07:31 
Re: The Fundamental Confusion of Xah
Benjamin Teuber <beteu  2008-07-17 18:09:46 
Re: The Fundamental Confusion of Xah
Joost Diepenmaat <joos  2008-07-18 03:23:31 
Re: The Fundamental Confusion of Xah
Kenny <kentilton@[EMAI  2008-07-18 02:13:16 
Re: The Fundamental Confusion of Xah
pjb@[EMAIL PROTECTED] (P  2008-07-18 07:32:44 
Canonical Indentation
Benjamin Teuber <beteu  2008-07-18 02:14:24 
Re: Canonical Indentation
pjb@[EMAIL PROTECTED] (P  2008-07-18 11:49:18 
Re: Canonical Indentation
Kent M Pitman <pitman@  2008-07-18 12:23:31 
Canonical Indentation
Benjamin Teuber <beteu  2008-07-18 02:15:32 
Canonical Indentation
Benjamin Teuber <beteu  2008-07-18 02:16:20 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 13:44:25 
Re: Canonical Indentation
Kent M Pitman <pitman@  2008-07-19 11:04:38 
Re: Canonical Indentation
Vassil Nikolov <vnikol  2008-07-19 11:26:30 
Re: Canonical Indentation
Pascal Costanza <pc@[E  2008-07-20 14:00:46 
Re: Canonical Indentation
Kent M Pitman <pitman@  2008-07-20 08:50:08 
Re: Canonical Indentation
pjb@[EMAIL PROTECTED] (P  2008-07-19 18:44:54 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 17:39:44 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 17:59:04 
Re: Canonical Indentation
Rainer Joswig <joswig@  2008-07-19 19:39:52 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 18:04:31 
Re: Canonical Indentation
Vassil Nikolov <vnikol  2008-07-19 21:32:03 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 03:14:32 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-21 14:35:01 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-21 15:58:31 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-22 12:26:02 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-22 16:04:04 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-26 00:10:04 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-26 00:05:02 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-26 15:16:20 
Re: The Fundamental Confusion of Xah
Matthias Buelow <mkb@[  2008-07-28 13:22:44 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-28 16:52:46 
Re: The Fundamental Confusion of Xah
Matthias Buelow <mkb@[  2008-07-29 13:47:24 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-28 20:15:15 
Re: The Fundamental Confusion of Xah
"John Thingstad"  2008-07-28 22:47:28 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-24 05:42:09 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 08:01:13 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-21 17:06:42 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 12:57:37 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 13:05:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 18:09:40 CST 2008.