News for hackers. Stuff that matters.
Re:GNU Shepherd by rnhmjoj on Saturday June 03, 2017 @08:00AM (#14475993)
It may be stupid but that syntax makes me feel a little uneasy. The unmatched single quotes reminds me of TemplateHaskell.
Re:GNU Shepherd by brianon99 on Saturday June 03, 2017 @08:45AM (#14476148)
Single quote denotes a symbol in scheme. But this snippest is not strictly scheme. Perhaps it is SXML but I am not familiar with it.
Re:GNU Shepherd by orangeshark on Saturday June 03, 2017 @09:31AM (#14476298)
A single quote is actually shorthand for the quote special form

  'foo
  (quote foo)
  '(1 2 3)
  (quote (1 2 3))
It basically does not evaluate its arguments but returns whatever it is. So instead of the value of foo, it the symbol foo. The list example does not evaluate it either, it would normally try to apply the first element as a function, but instead we get the list of numbers.
Re:GNU Shepherd by rekado on Saturday June 03, 2017 @09:11AM (#14476232)
This is just Scheme. It's nothing to do with SXML.

#:foo is a keyword argument and '(apache httpd) is a quoted list containing the symbols apache and httpd.

Angled brackets have no special meaning, they are just part of the identifier.

Re:GNU Shepherd by cyphar on Saturday June 03, 2017 @08:49AM (#14476158)
While I don't write Scheme, I believe it is Scheme -- one of the goals of the GNU project is to have every GNU tool be configurable with Scheme (which is why GNU has a Scheme implementation as opposed to a Common LISP implementation).
Re:GNU Shepherd by the_why_of_y on Saturday June 03, 2017 @09:39AM (#14476322)
Not only does GNU have a Common Lisp implementation, in fact there are two:

GCL: https://www.gnu.org/software/gcl/

CLISP: http://clisp.org/

Re:GNU Shepherd by cyphar on Saturday June 03, 2017 @10:04AM (#14476435)
I've installed CLISP before, why didn't I know it was a GNU project? Fair enough, I stand corrected. :D
Re:GNU Shepherd by brians on Saturday June 03, 2017 @09:41AM (#14476328)
Well, they have GCL and CLisp too!
Re:GNU Shepherd by Ericson2314 on Saturday June 03, 2017 @10:00AM (#14476414)
Template Haskell (and Rust) gets this from Lisp, ultimately.
Re:GNU Shepherd by cyphar on Saturday June 03, 2017 @10:03AM (#14476432)
Rust's usage of single quotes comes from CS language theory (lifetimes are denoted using quotes) which I believe comes from the normal usage of quotes in possessive words (James', Amanda's). I don't think LISP's usage comes from the same place (it means something very different semantically).
Re:GNU Shepherd by steveklabnik on Saturday June 03, 2017 @10:47AM (#14476606)
OCaml's usually what I see cited as the reason for Rust adopting the syntax.
Re:GNU Shepherd by mcguire on Saturday June 03, 2017 @11:11AM (#14476732)
... where it's a type variable.

I think we can blame the use for lifetimes entirely on the Rusties.

Re:GNU Shepherd by steveklabnik on Saturday June 03, 2017 @11:58AM (#14476960)
Lifetimes are also types, or more specifically, generic type parameters.
Re:GNU Shepherd by cyphar on Saturday June 03, 2017 @12:14PM (#14477027)
I believe the community name is Rustacean[1].

[1]: http://www.rustaceans.org/

Re:GNU Shepherd by Jtsummers on Saturday June 03, 2017 @10:41AM (#14476564)
Lisp's quote (or ') comes from the word quote and the context:

  (quote something)
Meaning: take whatever follows and leave it alone. Do not interpret it. If it's a list it stays a list (one of the main uses for this). The single quote ' is shorthand for that. It's meant to be an easier way to create a literal list (and other things) without escaping all the parts of a list that might be misinterpreted as symbols to evaluate (to values or functions).