Re: Clojure Objects

2015-11-24 Thread Bobby Bobble
spooky action at a distance - back to OO again! On Tuesday, November 24, 2015 at 3:21:45 PM UTC, William la Forge wrote: > > As in quantum entanglement? :-) > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: Clojure Objects

2015-11-24 Thread William la Forge
As in quantum entanglement? :-) -- 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

Re: Clojure Objects

2015-11-24 Thread Nahuel Greco
Maybe a better word for complecting is "entangling". Saludos, Nahuel Greco. On Tue, Nov 24, 2015 at 5:19 AM, Colin Yates wrote: > > (Clojure's vocabulary is not to be questioned...why say "conflate" or > "confuse" when you can say "complect" to reinforce in-group membership ?) > /rant > > THANK

Re: Clojure Objects

2015-11-24 Thread Timothy Baldridge
>> But, if someone has to explain the etymology of their word to you for it to make >> sense, then the word has failed. If I took that approach with my kids, they'd never get out of first-grade. Timothy On Tue, Nov 24, 2015 at 7:23 AM, Bobby Bobble wrote: > "Careful - ‘complect’ has a very spe

Re: Clojure Objects

2015-11-24 Thread Bobby Bobble
"Careful - ‘complect’ has a very specific meaning" OK something to do with braiding, yes. But, if someone has to explain the etymology of their word to you for it to make sense, then the word has failed. If you mean "braided" say "braided", or better still "tangled"! I mean, "braided" or "p

Re: Clojure Objects

2015-11-24 Thread Bobby Bobble
On Tuesday, November 24, 2015 at 8:19:41 AM UTC, Colin Yates wrote: > > > (Clojure's vocabulary is not to be questioned...why say "conflate" or > "confuse" when you can say "complect" to reinforce in-group membership ?) > /rant > > THANK YOU! I can't count the number of times I've had to restr

Re: Clojure Objects

2015-11-24 Thread Colin Yates
> > (Clojure's vocabulary is not to be questioned...why say "conflate" or > > "confuse" when you can say "complect" to reinforce in-group membership ?) > > /rant > > THANK YOU! I can't count the number of times I've had to restrain myself > from an apoplectic rant about this hideous non-word.

Re: Clojure Objects

2015-11-23 Thread Gregg Reynolds
On Nov 23, 2015 4:23 PM, "Gregg Reynolds" wrote: > > > On Nov 23, 2015 6:34 AM, "Bobby Bobble" wrote: > > > > functions. E.g. it's as nullary fns. Sorry, "ints", not "it's ". How I hate spell-checkers!! -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: Clojure Objects

2015-11-23 Thread Gregg Reynolds
On Nov 23, 2015 6:34 AM, "Bobby Bobble" wrote: > > let's not forget that Clojure's datastructures are objects. They respond to messages like seq, first, rest etc (which requires a bit more complexity than what Clojurians hail as "just data", which would be like 1010101101010100011011..

Re: Clojure Objects

2015-11-23 Thread Bobby Bobble
let's not forget that Clojure's datastructures are objects. They respond to messages like seq, first, rest etc (which requires a bit more complexity than what Clojurians hail as "just data", which would be like 1010101101010100011011...what Clojurians really mean by that term is som

Re: Clojure Objects

2015-11-21 Thread William la Forge
Hi James! I'll be the first to admit that I do not yet have a strong case here. And yeah, it looks like I'm introducing some boilerplate myself to do things this way. Which probably just means that I need to learn how to write macros or some such. :-) I was just saying that the calf and yearli

Re: Clojure Objects

2015-11-21 Thread James Reeves
On 21 November 2015 at 04:50, William la Forge wrote: > > The reason for having this "type of object" at all is that I was going to > have 3 copies of the same code. Which I find to be a bad thing. > Could you explain why you were going to have duplicate code, and how your object system solved th

Re: Clojure Objects

2015-11-20 Thread William la Forge
Timothy, I've been thinking about this a bit more and I see that you can supply data via a function in a function map that is part of extend. And while self reference between the various parts of a composite can get awkward, you can always revert to a function to complete that self-reference th

Re: Clojure Objects

2015-11-20 Thread William la Forge
The advantage of maps over records is if I have 3 objects as maps I can easily munge them into a single map. But if I have 3 objects as records, I loose that option. OK, I can nest records inside each other but it is not the same. With objects as maps I've got something closer to mixins. But not ty

Re: Clojure Objects

2015-11-20 Thread Timothy Baldridge
You might want to read up on records and protocols in clojure. This is pretty much the use case for which they were designed. Timothy On Friday, November 20, 2015, William la Forge wrote: > You can tell I'm still new to clojure. The composition should have been > written like this: > > (-> opts

Re: Clojure Objects

2015-11-20 Thread William la Forge
You can tell I'm still new to clojure. The composition should have been written like this: (-> opts (db-file-open) (db-cache-start) etc) -- 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 No

Re: Clojure Objects

2015-11-20 Thread William la Forge
James, The advantages of one style over another are often subtle. And indeed, a single object written this way has no real advantage. Poor choice, but it was the only code I have written in this way so far. The addition of closures only occurred to me while writing this piece of code. I includ

Re: Clojure Objects

2015-11-20 Thread James Reeves
What's the benefit to writing code like this? The only thing I could possibly see as being considered an advantage is that it encapsulates the file channel, but you've exposed that via a key anyway. - James On 21 November 2015 at 02:54, William la Forge wrote: > Code as data is the mantra. Fun

Re: Clojure Objects

2015-11-20 Thread William la Forge
Oh! Some minor edits. Which can be found here: https://github.com/laforge49/aatree/wiki/Clojure-Objects -- 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 n

Clojure Objects

2015-11-20 Thread William la Forge
Code as data is the mantra. Functions and closures as data. So why not objects as data? What I propose is nothing new, but perhaps a new style. Making objects from map structures is simple enough in Clojure. And easy enough to put functions in a map. So why not closures? A closure in a map is

Re: Question on passing clojure objects in OSGI

2013-07-01 Thread Rama Shenai
>: > > Hi, > > > > I have an OSGI (Karaf) setup where I have two isolated instances of > Clojure > > deployed & running in two bundles (within the same JVM), > > and I am seeing a problem where passing Clojure Objects (such as > > PersistentArra

Re: Question on passing clojure objects in OSGI

2013-07-01 Thread Laurent PETIT
2013/7/1 Rama Shenai : > Hi, > > I have an OSGI (Karaf) setup where I have two isolated instances of Clojure > deployed & running in two bundles (within the same JVM), > and I am seeing a problem where passing Clojure Objects (such as > PersistentArrayMaps) from one clo

Question on passing clojure objects in OSGI

2013-07-01 Thread Rama Shenai
Hi, I have an OSGI (Karaf) setup where I have two isolated instances of Clojure deployed & running in two bundles (within the same JVM), and I am seeing a problem where passing Clojure Objects (such as PersistentArrayMaps) from one clojure bundle to another, breaks clojure interfaces at

Re: Sending Clojure Objects over TCP

2013-02-07 Thread Feng Shen
slacker - Transparent, non-invasive RPC by clojure and for clojure. https://*github*.com/sunng87/*slacker* * * 1. 2. On Thursday, February 7, 2013 9:16:03 AM UTC+8, JvJ wrote: > > Does anyone know if there's a simplified networking library that allows > this? -- -- You received

Re: Sending Clojure Objects over TCP

2013-02-07 Thread Matthew
Aleph On Thursday, February 7, 2013 12:16:03 PM UTC+11, JvJ wrote: > > Does anyone know if there's a simplified networking library that allows > this? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Sending Clojure Objects over TCP

2013-02-06 Thread Softaddicts
To send clojure values: http://clojuredocs.org/clojure_core/clojure.core/pr-str You may need to extend print-dup if you need to stringify Java objects or defrecords. http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging Have a nice reading and come back if som

Re: Sending Clojure Objects over TCP

2013-02-06 Thread JvJ
I was just looking for sending data structures. But hey, if RPC existed that would be cool too. On Wednesday, 6 February 2013 20:24:54 UTC-5, Luc wrote: > > Objects ?!?!? You want to exchange only data structures ? > Or do you expect some form of RPC ? > > Luc P. > > > > Does anyone know if t

Re: Sending Clojure Objects over TCP

2013-02-06 Thread Softaddicts
Objects ?!?!? You want to exchange only data structures ? Or do you expect some form of RPC ? Luc P. > Does anyone know if there's a simplified networking library that allows > this? > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. >

Re: Sending Clojure Objects over TCP

2013-02-06 Thread Jay Fields
http://code.google.com/p/jetlang/wiki/Remoting On Wed, Feb 6, 2013 at 8:16 PM, JvJ wrote: > Does anyone know if there's a simplified networking library that allows > this? > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this

Sending Clojure Objects over TCP

2013-02-06 Thread JvJ
Does anyone know if there's a simplified networking library that allows this? -- -- 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

Re: Serializing Clojure objects

2008-12-03 Thread Rich Hickey
On Tue, Dec 2, 2008 at 6:38 PM, Chouser <[EMAIL PROTECTED]> wrote: > > On Tue, Dec 2, 2008 at 3:52 PM, Mark Volkmann <[EMAIL PROTECTED]> > wrote: > > > > (def my-string (print-dup [1 2 3])) > > (def my-data (read my-string)) > > > > Can you give a simple example of serializing and deserializing a

Re: Serializing Clojure objects

2008-12-02 Thread Chouser
On Tue, Dec 2, 2008 at 3:52 PM, Mark Volkmann <[EMAIL PROTECTED]> wrote: > > (def my-string (print-dup [1 2 3])) > (def my-data (read my-string)) > > Can you give a simple example of serializing and deserializing a > Clojure collection? For "serializing" you have a couple options: (def my-string

Re: Serializing Clojure objects

2008-12-02 Thread Mark Volkmann
function >> > which serializes and deserializes Clojure objects. It works for >> > strings, integers, symbols, LazilyPersistentVectors and.. oddly.. >> > PersistentHashMaps that have exactly one element. (My Clojure is about >> > a month old.) >> >> I am n

Re: Serializing Clojure objects

2008-12-02 Thread Parth Malwankar
On Dec 2, 11:52 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > As part of AOT I needed to enhance print/read to store constants of > many kinds, and restore faithfully. This led to a new multimethod - > print-dup, for high-fidelity printing. You can get print-dup behavior > by binding *print-dup*:

Re: Serializing Clojure objects

2008-12-02 Thread Rich Hickey
On Dec 2, 7:02 am, Parth Malwankar <[EMAIL PROTECTED]> wrote: > Tayssir John Gabbour wrote: > > Hi! > > > How should I approach serialization? I made a little test function > > which serializes and deserializes Clojure objects. It works for

Re: Serializing Clojure objects

2008-12-02 Thread Jeff Rose
e protocol definition phase. Hopefully that helps. -Jeff Tayssir John Gabbour wrote: > Hi! > > How should I approach serialization? I made a little test function > which serializes and deserializes Clojure objects. It works for > strings, integers, symbols, LazilyPers

Re: Serializing Clojure objects

2008-12-02 Thread Tayssir John Gabbour
m, Tayssir John Gabbour <[EMAIL PROTECTED]> wrote: > Hi! > > How should I approach serialization? I made a little test function > which serializes and deserializes Clojure objects. It works for > strings, integers, symbols, LazilyPersistentVectors and.. oddly.. > Persis

Re: Serializing Clojure objects

2008-12-02 Thread Dakshinamurthy Karra
le of developpers disconnected from real life. >> In real life your systems are running and you may not be able to >> interrupt services for a long period to upgrade them >> all at once. You may have to do so in multiple steps and without >> interrupting

Re: Serializing Clojure objects

2008-12-02 Thread Parth Malwankar
Tayssir John Gabbour wrote: > Hi! > > How should I approach serialization? I made a little test function > which serializes and deserializes Clojure objects. It works for > strings, integers, symbols, LazilyPersistentVectors and.. oddly.. > PersistentHashMaps that have exactl

Re: Serializing Clojure objects

2008-12-02 Thread Tayssir John Gabbour
nt the data serialized, not the access to it... > > If size of the YAML output becomes an issue then zip it. > > Luc > > On Tue, 2008-12-02 at 00:57 -0800, Tayssir John Gabbour wrote: > > Hi! > > > How should I approach serialization? I made a little test function > &

Re: Serializing Clojure objects

2008-12-02 Thread Luc Prefontaine
ade a little test function > which serializes and deserializes Clojure objects. It works for > strings, integers, symbols, LazilyPersistentVectors and.. oddly.. > PersistentHashMaps that have exactly one element. (My Clojure is about > a month old.) > > But for other things, li

Re: Serializing Clojure objects

2008-12-02 Thread Tayssir John Gabbour
On Dec 2, 9:57 am, Tayssir John Gabbour <[EMAIL PROTECTED]> wrote: > (defn my-identity "Copies obj through serialization and > deserialization." > [obj] > (let [byte-out (new java.io.ByteArrayOutputStream) > obj-out (new java.io.ObjectOutputStream byte-out)] > (try (.writeObject o

Serializing Clojure objects

2008-12-02 Thread Tayssir John Gabbour
Hi! How should I approach serialization? I made a little test function which serializes and deserializes Clojure objects. It works for strings, integers, symbols, LazilyPersistentVectors and.. oddly.. PersistentHashMaps that have exactly one element. (My Clojure is about a month old.) But for