News for hackers. Stuff that matters.
Re:Snek: An experimental system for writing generative art s... by kowdermeister on Sunday June 11, 2017 @01:28PM (#14532809)
I find the description confusing: "snek is a simple data structure for working with vertices and edges"

If I hear data structure lisp code is not on my mind, so it's rather an API or a drawing library?

What am I manipulating exactly?

    ; context start
   (with-snek (snk)
What's in `snk`? Sorry, I never used lisp before

Do you plan to write an API documentation?

Re:Snek: An experimental system for writing generative art s... by aerique on Sunday June 11, 2017 @03:12PM (#14533270)
If I hear data structure lisp code is not on my mind, so it's rather an API or a drawing library?

Most Lisps, especially Common Lisp which inconvergent is using, have plenty of data structures: http://www.lispworks.com/documentation/lw70/CLHS/Front/Conte...

Common Lisp doesn't have a nice literal structure for hash tables/maps/dicts but that is easily mended with a macro.

"(with-snek (snk) ..." is a macro which abstracts away lower level tedious boilerplate. It hands you "snk" on a platter so you can manipulate it.

Common Lisp itself also comes with some of these macros: http://www.lispworks.com/documentation/lw70/CLHS/Front/X_Alp...

"with-open-file" (skip to the examples) is a nice one since it takes care of opening and closing the file for you so you can write your block of code inside of it and be sure the file gets opened and closed properly:

    (with-open-file (f "/path/to/file" :direction :output :if-exists :supersede)
      ... your code writing to "f" comes here ...
      )
Re:Snek: An experimental system for writing generative art s... by inconvergent on Sunday June 11, 2017 @01:41PM (#14532875)
you manipulate a data structure that contains vertices and edges. there is more about it here http://inconvergent.net/snek-is-not-an-acronym/.

snk is an instance of snek, so it contains a realisation of the structure and its current state.

Re:Snek: An experimental system for writing generative art s... by pje on Sunday June 11, 2017 @03:06PM (#14533243)
so...snk is a graph?
Re:Snek: An experimental system for writing generative art s... by Retra on Sunday June 11, 2017 @10:16PM (#14534873)
Most data structures are graphs. This one just happens to be "self-aware" enough to use graph terminology.
Re:Snek: An experimental system for writing generative art s... by inconvergent on Sunday June 11, 2017 @03:10PM (#14533265)
yes, it is.