DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

TypeInference > BeautifulCode > ReadEvalPrint > JamieZawinski > PythonSprache > GuisInClojure > Continuations > SpaghettiCode > DanielWeinreb > TuringMachine > PythonHacking > BertrandMeyer > DynamicTyping > ClojureMacros > BarbaraLiskov > DestroyJavaVM > ClojureIdiomsClear Trail
Main /

Clojure Idioms

Clojure
ClojureIdomaticSnippets

ClojureSequences
ClojureReferenceTypes
GuisInClojure

XmlWithClojure





Sequences


Namespaces

Unlike CL, symbols are just names, with no associated values. The things that are more like symbols from that perspective in Clojure are vars, and it is vars that are interned in namespaces. Two symbols with the same name can be distinct objects. A namespace is not a set of symbols but a set of mappings from symbols to references - either vars or classes.

This separation of concerns is an important part of how Clojure is a Lisp-1 while still supporting defmacro semi-hygienically. The reader reads plain symbols and does no interning. The compiler resolves names (symbols) in the compilation namespace in order to find vars/classes. def interns new vars, and import/refer/use can make new mappings.


loaded or standalone script? -> Scripted Main

  ; Only run the application if this is being run as a script,
 ; not if loaded in a REPL with load-file.
 ; When run as a script, the path to this file
 ; will be a command-line argument.
 (if *command-line-args* (main))
also see PythonIdioms#main

Note: This does not work if the standalone-script does not get any parameters passed.


Commandline


Data types / defrecord, deftype, reify, protocol, proxy


Symbols


#clojure IRC channel

 Chouser: ,(some #{'c} '(a b c)) 
 clojurebot: c 
 gko: why , in front of your samples?
 ataggart: it tells clojurebot to execute it 

Keyword Arguments


Performance


SoftwareTransactionalMemory


Compiler


Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 26.12.2011 10:16 Uhr und seit 7. April 2005 205 aufgerufen.