Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: ++CD-ROM drive
- To: Darren Cook <darrenj@example.com>
- Subject: Re: ++CD-ROM drive
- From: "Stephen J. Turnbull" <turnbull@example.com>
- Date: Thu, 7 Jun 2001 21:16:03 +0900
- Cc: tlug@example.com
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <3B1F6097.292115E8@example.com>
- References: <3B1F4F26.20690.001@example.com><3B1F6097.292115E8@example.com>
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <KYGkGD.A._SH.WC3H7@example.com>
- Resent-Sender: tlug-request@example.com
>>>>> "Darren" == Darren Cook <darrenj@example.com> writes: Darren> Is this how lisp does generic code as well? No. Lisp has much stronger typing, although it is dynamic. Lisp has two mechanisms for generic code. One is polymorphic functions. That means that the function will accept different kinds of arguments, and do the right thing with them. Like Python, most Lisps provide lists, vectors, and strings. Also like Python, most Lisps provide functions which will accept any of those and do the right thing with them, or even mixtures. The second is macros. A macro takes the arguments without interpreting them, and computes an expression involving them. This expression is then evaluated to get the value of the macro call. The reason this is efficient is that at compile time you don't need to know the values of the arguments, so the macro expansion is done at compile time and inlined into the compiled code. I know of no other language with this feature. You can of course compute Python (or Perl or sh) expressions as strings and recursively evaluate them, but AFAIK all those languages can only do the expansion at runtime. Because a Lisp program is also valid Lisp data and vice-versa, it is almost trivial to build it into the language, and thus allow efficiently compiled macros. Darren> Lisp is also interpreted rather than compiled isn't it? Almost all Lisp implementations do provide interpreters, but almost all do compile to a virtual machine (and not always so virtual). A few compile to C or whatever (I've never used them, though). -- University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091 _________________ _________________ _________________ _________________ What are those straight lines for? "XEmacs rules."
- References:
- Re: ++CD-ROM drive
- From: vp@example.com (Viktor Pavlenko)
- Re: ++CD-ROM drive
- From: Darren Cook <darrenj@example.com>
Home | Main Index | Thread Index
- Prev by Date: RE: ++CD-ROM drive
- Next by Date: RE: ++CD-ROM drive
- Prev by thread: Re: ++CD-ROM drive
- Next by thread: RE: ++CD-ROM drive
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links