On Tue, Dec 10, 2013 at 11:46 PM, Cedric Greevey wrote:
> On Tue, Dec 10, 2013 at 6:29 PM, Vincent Chen wrote:
>>
>> Try this (not tested, might be missing parens and whatnot):
>>
>> (defn slice [x s n]
>> (loop [[h & tail] x, s s, n n, acc []
accumulator. The accumulator
carries the eventual result, which is returned at the base case.
- Since we're destructuring into head and tail, I used vectors. conj
will push to the end of the vector.
- In Clojure, vectors tend to be more natural than lists. Accumulating
into lists usually requires a
On Thu, Sep 26, 2013 at 1:49 AM, Marshall Bockrath-Vandegrift
wrote:
> Vincent Chen writes:
>
>> - Use something else than records to model structs (suggestions welcome)?
>
> Maps.
>
> Records have concrete Java types, which allows them to implement
> interfaces a
tion and validation you could consider prismatic/schema [1] as a
> translation target, and just represent your data with maps.
>
> [1] https://github.com/Prismatic/schema
>
>
> On Wednesday, September 25, 2013 10:47:35 PM UTC-7, Vincent Chen wrote:
>>
>> Hi,
>>
&
Hi,
I have in my hands an XML description of data structures that I want
to mechanically translate into Clojure. There are and
elements, with being similar to structs in C (list
of fields) and being similar to typedef in C (defining new
name for already defined s).
I model s using Clojure rec
onvince me otherwise.
Thanks,
Vincent
On Wed, Sep 25, 2013 at 1:50 AM, Adam Clements wrote:
> Have you looked at core.async for shuttling asynchronous events back and
> forth. This sounds to me like the sort of thing it was designed for
>
> On 10 Sep 2013 06:30, "Vince
tching? Is there a better way of implementing events?
Regards,
Vincent Chen
--
--
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 -