Skip to content

Instantly share code, notes, and snippets.

@amontalenti
Created December 24, 2013 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amontalenti/8114383 to your computer and use it in GitHub Desktop.
Save amontalenti/8114383 to your computer and use it in GitHub Desktop.
Python example of lightweight data modelling
def main():
some_items = [1, 2, 3, 4]
for item in some_items:
print item
some_mapping = {"ST": "started", "IP": "in progress", "DN": "done"}
for key, val in some_mapping.iteritems():
print key, "=>", val
if __name__ == "__main__":
main()
@jpfuentes2
Copy link

Clojure:

(doseq [item [1 2 3 4]]
  (println item))

(doseq [[k v] {:ST "started", :IP "in progress", :DN "done"}]
  (println (str k " => " v)))

@amontalenti
Copy link
Author

Thanks @csoma -- based on @jpfuentes2's starting point, I gave my hand to a closer Clojure example here:

Clojure: https://gist.github.com/amontalenti/8117294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment