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 > Functional > Re: the necessi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 30 of 33 Topic 2757 of 2904
Post > Topic >>

Re: the necessity of Lisp's Objects?

by Jon Harrop <usenet@[EMAIL PROTECTED] > Feb 16, 2008 at 08:46 PM

Robert Maas, see http://tinyurl.com/uh3t
wrote:
> From: Jon Harrop <use...@[EMAIL PROTECTED]
>
>> Mathematica lacks static type checking
> 
> So there's no way to assert a fact about some data value somewhere
> in your code and have the compiler warn you if that fact can't be
> guaranteed based on what it knew earlier in the same code?

You only have run-time assertions in Mathematica.

>> Callcc is a lot more like forking than threads.
> 
> I've been under the impression that forking was a special case of
> multiple threads, where a single thread spawns two continuation
> threads, taking opposite paths from some branch point, and the
> original thread then waits for both to complete before combining
> their results and proceeding as a single thread.

The difference is that with forked threads the OS can lazily copy the
shared
heap as it is mutated. So if you create a big immutable data structure and
then fork two threads that use it, you get sharing of the data structure
for free. If you use vanilla threads then you must either work with
explicit sharing or do a deep copy of the data structure.

>> Arrays are Mathematica's primitive data type and it calls them
>> (confusingly) "List"s.
> 
> Well they *are* lists i.e. vectors, they just aren't linked lists,
> they're contiguous lists, which have some advantages and some
> disadvantages compared with linked lists. Can elements of
> Mathematica's contiguous lists be contiguous lists (arrays)
> themselves?

Yes, that's exactly how it works.

>> But Mathematica's equivalent of cons cells are arrays of objects,
>> so they can store an arbitrary number of elements contiguously.
>> Speaking of which, why doesn't Lisp do that?
> 
> No, you're wrong. Mathematica doesn't have an exact equivalent of
> CONS cells, i.e. ordered pairs of a distinct type different from
> any multi-pointer object. Lisp has the equivalent of Mathematica's
> "lists", namely one-dimensional general arrays. Lisp has *both*
> kinds of objects, one-dimensional general arrays which can hold any
> number of pointers, and CONS cells which are specialized to have
> exactly two pointers and to be more efficient than a two-element
> general array. CONS cells are *not* a sub-type of general arrays,
> whereas a list of two elements in Mathematica, as you cite, *is* a
> sub-type of multi-element lists.

Ok, yes.

> Now it would be possible in Lisp to use two-element general arrays
> as if CONS cells: Have a new version of READ that generated them
> where CONS cells would normally be generated, a new version of
> PRINT that printed as if they were CONS cells, and a new version of
> EVAL that traversed them just as the regular EVAL traversed regular
> CONS cells. That would be a cute hack, even if of no practical
> value.

Assuming that is possible, why didn't scheme do it part of "cutting down"
Lisp?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u
 




 33 Posts in Topic:
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-04 10:37:38 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-06 17:14:18 
Re: the necessity of Lisp's Objects?
"John Thingstad"  2008-02-06 19:42:31 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-07 00:07:54 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-09 15:14:09 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-10 10:27:07 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-15 23:12:34 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-16 21:02:03 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-09 15:21:54 
Re: the necessity of Lisp's Objects?
"John Thingstad"  2008-02-10 01:48:39 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-11 23:29:33 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 16:37:06 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-07 22:25:25 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-08 21:06:41 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-09 15:24:21 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-10 10:26:42 
Re: the necessity of Lisp's Objects?
"David Formosa (aka   2008-02-10 11:23:32 
Re: the necessity of Lisp's Objects?
George Neuner <gneuner  2008-02-10 23:54:27 
Re: the necessity of Lisp's Objects?
rpw3@[EMAIL PROTECTED] (  2008-02-11 02:56:22 
Re: the necessity of Lisp's Objects?
George Neuner <gneuner  2008-02-11 20:53:12 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 02:17:33 
Re: the necessity of Lisp's Objects?
"John Thingstad"  2008-02-12 04:48:24 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 16:35:17 
Re: the necessity of Lisp's Objects?
George Neuner <gneuner  2008-02-12 15:18:23 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 20:16:55 
Re: the necessity of Lisp's Objects?
rpw3@[EMAIL PROTECTED] (  2008-02-12 05:34:01 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-11 10:41:47 
Re: the necessity of Lisp's Objects?
Barb Knox <see@[EMAIL   2008-02-11 09:52:26 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-15 23:17:07 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-16 20:46:11 
Re: the necessity of Lisp's Objects?
Pascal Bourguignon <pj  2008-02-08 22:33:21 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-20 15:25:52 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-20 17:12:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Fri Jul 18 20:42:38 CDT 2008.