On Tue, 17 Jul 2018 at 21:06, Christian Seberino <cseber...@gmail.com>
wrote:

>
> Clojure, on the other hand, takes great care to ensure that its data can
>> always be represented as literals. For data that isn't a standard
>> collection type, there are tagged literals. Clojure syntax starts from a
>> representation of data, and in order to really understand it, I think it
>> needs to be taught from this principle as well
>>
>
> Can you elaborate?  I really want to get your point but I'm not so
> proficient with the lingo.  What do you mean by a "literal" and "tagged
> literals"?
>

A data literal evaluates to itself. So for example, `2` is a literal,
because we only need to read it to know its value, whereas `(+ 1 1)` isn't
a literal, because we also need to evaluate it to work out the value.

A tagged literal is a literal preceded by a tag. For example, `#inst
"2018-07-17T20:45:59.766-00:00"` is a literal string preceded by the tag, `
#inst`, which denotes that the string holds a datetime.

And how is a focus on the representation of data different than Python
> beyond Python's less elegant grammar?
>

Clojure is unusual in that it dedicates the vast majority of its syntax to
describing data structures. When other languages introduce new syntax, it's
often syntax that improves how code is represented, rather than literal
data.

Other lisps have syntax revolving around data structures as well, of
course, but they tend to prioritise minimalism, whereas Clojure seeks - in
my view - to better describe data without stooping to evaluation.
Traditionally lisps have rejected any collection literals beyond lists,
whereas Clojure extends that to maps, sets and vectors.

When writing software in Clojure, the data structures are often the
keystone of the codebase. When I write Clojure, I start by mapping out what
data structures and keywords I need, and from there write functions around
them. It's for this reason that I don't think prepend and append functions
are particularly useful for students, as the teacher should be encouraging
them to think *more* about the data structures they're using, not less.

-- 
James Reeves
booleanknot.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to