Fork me on GitHub
#beginners
<
2019-10-13
>
Crispin07:10:44

Hi everyone. I have a function taking and output stream. I want to provide an output stream object that builds up the data in memory. I don't want to write to a file, or stream it (because its size bound and what I'm passing it to doesn't support readers/writers/streaming). How do I create a "memory output stream" or a "memory writer" in clojure?

Crispin07:10:56

never mind. found it.

(java.io.ByteArrayOutputStream.)
and then on that output stream
(.toString my-output-stream)

Abhinav Sharma07:10:00

Hello 🙂 Could anyone please tell me the best way to read an array size and array elements from standard input in clojure? for is there, but maybe there’s a more idiomatic solution.

Lu10:10:44

I would say it depends on what your output should look like .. you can do it with many functions

đź‘Ť 4
Abhinav Sharma11:10:58

Okay, so I need to read in the size of an array and then read the elements of that array.

3
1
2
3

abdullahibra12:10:53

Hello everyone

abdullahibra12:10:30

i use s/def to add record for spec, how can i remove it is there something like unregister ?

Alex Miller (Clojure team)13:10:52

Use s/def again with a nil spec

abdullahibra12:10:15

is there a scope for defining specs, for example, can i do this on function level so the defined specs only defined withing functions and outside it No ?

Alex Miller (Clojure team)13:10:09

If you’re using the registry, no. But you can use s/valid? etc with spec definitions directly (except for the attributes in s/keys)

abdullahibra12:10:50

what i'm trying to do is validate data via function

sova-soars-the-sora19:10:52

i need help making compojure routes work with destructuring

sova-soars-the-sora19:10:50

I want to auto-render various pages when the user navigates to lessons/S1&L7&P5 for example, so they will go to Section 1 Lesson 7 Part 5 ... is this the easiest way to put arguments together, or are there nicer symbols i can use to separate vars in compojure-land?

Mark Bailey21:10:31

Hello, all! I just wanted to pop in and say this: as I am implementing each part of the project I'm working on in Clojure, I find myself falling more and more in love with the language. The further in I go, and mind you I've only touched what I believe to be the surface layers, it just gets better and better. Coming from OO (http://vb.net, python, Ruby, etc.) This is a gosh darned fantasy come true. I've never felt more enthralled by programming than when I use Clojure. Thank you guys for the support you provided during my baby steps, I'm now walking, and soon I'll be at full sprint!

rich 36