help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why not "stripes" in: (let ((zebra 'stripes) ... ; strings vs symbol


From: Emanuel Berg
Subject: Re: why not "stripes" in: (let ((zebra 'stripes) ... ; strings vs symbols?
Date: Thu, 02 Jan 2014 15:31:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Rustom Mody <rustompmody@gmail.com> writes:

>> So they did a new language just to get
>> pattern-matching in Lisp! I'm unsure if that is
>> sheer folly *or* dedication that should be admired.
>
> I wrote a destruct macro in scheme -- gives most of
> what pattern matching gives in the SML language
> family -- all of 91 lines.  So much for lisp not
> having pattern matching.

Yes, if you recall, I mentioned the possibility of
solving that with a macro. Although I couldn't do it (I
never did any macros, perhaps I should), I suspected it
was possible and it is impressive that you pulled that
off. *Much* better than doing a whole new language,
though I also suspect (certainly hope!) that Shen
(apparently "spirit" in Chinese) brings something else
to the table as well. But pattern matching is the first
thing they mention (twice), so perhaps it is just
another case of a bunch of techno-science guys who did
a language just for the challenge and sweet science to
it. Again, if so, I say it is a bit aristocratic but
there is no denying cred to people who do stuff they
love at a very advanced level.

> Type-discipline is very different issue altogether.
> I dont believe that any macro (system) can do that
> for lisp.

Couldn't you somehow annotate data: '('integer 1) and
then prior to assignment run an appropriate test:
(integerp ... )

But I still don't understand the benefit of having the
types explicit in code, apart from the mentioned
compiler type-check - is there anything else to it?
Could you overload functions based on types? (And: do
you *want* to do that?) Could the compiler perform
optimizations if there are, for example, only integer
(and no float) arithmetic? Or is it just a safety-net
so you don't get overflows and truncations and thus
bugs that are very difficult to track? Why is this not
an issue in Lisp? Is Lisp and C very different in this
respect, and if so, how?

> The issue is that in CS one can choose structuring or
> universality.  Some of the most powerful ideas in CS
> come from universality considerations, eg - von
> Neumann machines equivalencing data and code - Turing
> machine -> universal turing machine - Unix -- the
> byte stream as able to carry any and all data.

Yes, this is concepts of the CS curriculum but you'll
have to explain how it applies to the discussion about
types.

> and start putting up railings -- structurings

I think there are more down-to-earth and
implementation-specific reasons - that people in
general are "afraid to fly" might be part of it on a
more philosophical level, though.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]