Re: Bug in clojure.core/take lazy seq?

2016-10-25 Thread Zalan Barczal
Indeed you're right, the drop lazy-seq prevents the lookahead.

Thanks Meikel for the thoughtful response!

On Tuesday, October 25, 2016 at 2:36:26 AM UTC-4, Meikel Brandmeyer 
(kotarak) wrote:
>
> In fact, (doall (take (count t) t)) actually realises t completely. But 
> not because of the doall or take, but because of the count. The problem 
> is not take, it's the take-while of split-with, which is the trouble. You 
> know that the input is 50 items long. take-while does not. It has to 
> check the 51st item to identify the end of the sequence. So it has to hold 
> onto the head of the tail sequence. No matter what your (take 50 t) does. 
> This combined with the fact, that you hold onto the head of t with the (count 
> t) after the (count d).
>
> drop does obviously not look ahead due to the wrapping lazy-seq. This can 
> be easily verified in the repl. Please consider, that upon realisation via 
> seq, the first element of the remaining output has to be realised anyway!
>
> user> (def s (drop 2 (map #(doto % prn) (list 1 2 3 4 5
> #'user/s
> user> (def t (seq s))
> 1
> 2
> 3
> #'user/t
> user> 
>
> Again that notwithstanding drop could be optimised to save a wrapping 
> lazy-seq object in the case we call drop with 0. But that again is an 
> optimisation, not a bug. An implementation could look like this:
>
> (defn drop+
>   [n coll]
>   (if (pos? n)
> (lazy-seq (drop+ (dec n) (rest coll)))
> coll))
>
> In general lookahead is not debatable. A sequence function which looks 
> further ahead then absolutely necessary to perform its function is broken.
>
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Avi 0.1.9 - The Splits

2016-10-25 Thread Jason Felice
After a couple looong periods with a lot of work, and a few also long
periods of looking askance at the project with fear and being
intimidated, *splits are
here!!:*

:sp, :vsp, :e, h, j, k, l, and :q now quits one split
until there are none left.

Special thanks to *Arun S L*, who implemented:

, , , , , line and column info in the status
bar, some bug fixes.

(and also got me back in the game, thanks!)

Also this release, Avi now renders unicode characters correctly.

The next release will likely be integration with parinfer-jvm
.


avi

A lively vi.
Vision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
Guiding Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

Code of Welcoming
Conduct

Everybody has boundaries around who they invite into their home. To help
you decide whether you want to hang out with us, we've done our best to
describe our boundaries here in the maitria code of conduct
. It's not a bunch of legalese. It's who we are.
Please read it.
Contributing

We track upcoming work on a Trello board .
This board has many small things that are easy to pick up, and we'd love to
see you.

I (Jason Felice) would love to walk through the code with you pretty much
any time during the US Eastern work day. Ping me any time on Twitter - I'm
@eraserhd  - or gchat.
Status

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

Installing

   - Works with Leiningen 2.3.4
   - On Linux, libncursesw5-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install /usr/local

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead or specify a different installation
directory.
License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.match interactive tutorial - with KLIPSE

2016-10-25 Thread Yehonathan Sharvit
http://blog.klipse.tech/clojure/2016/10/25/core-match.html

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JOB] clojure fintech NUBANK

2016-10-25 Thread Thaís Starling
[JOB] Fintech - NUBANK
Engineer (Clojure)

https://nubank.workable.com


CURRENT OPENINGS

Software Engineer
São Paulo, Brazil · engineering

Systems Engineer (SRE/DevOps)
Sao Paulo, São Paulo, Brazil · engineering

Android - Senior Mobile Software Engineer
São Paulo, Brazil · engineering

iOS - Senior Mobile Software Engineer
São Paulo, Brazil · engineering

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JOB] Fintech Clojure - Nubank

2016-10-25 Thread Thaís Starling
https://nubank.workable.com

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Ann] Tempura, a Clj+Cljs i18n translations lib with support for React

2016-10-25 Thread Peter Taoussanis
Hi folks!

So this is the 1st of 4 libs I’ve been meaning to publish for forever.

Available at: https://github.com/ptaoussanis/tempura
Other libs (as usual) at: https://www.taoensso.com/clojure

Enjoy, cheers! :-)

\- Peter Taoussanis, [@ptaoussanis](https://twitter.com/ptaoussanis)

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug in clojure.core/take lazy seq?

2016-10-25 Thread Meikel Brandmeyer (kotarak)
However, the drop+ does not stop in case the input sequence is exhausted. 
So more waste there...


-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug in clojure.core/take lazy seq?

2016-10-25 Thread Meikel Brandmeyer (kotarak)
In fact, (doall (take (count t) t)) actually realises t completely. But not 
because of the doall or take, but because of the count. The problem is not 
take, it's the take-while of split-with, which is the trouble. You know 
that the input is 50 items long. take-while does not. It has to check the 
51st item to identify the end of the sequence. So it has to hold onto the 
head of the tail sequence. No matter what your (take 50 t) does. This 
combined with the fact, that you hold onto the head of t with the (count t) 
after the (count d).

drop does obviously not look ahead due to the wrapping lazy-seq. This can 
be easily verified in the repl. Please consider, that upon realisation via 
seq, the first element of the remaining output has to be realised anyway!

user> (def s (drop 2 (map #(doto % prn) (list 1 2 3 4 5
#'user/s
user> (def t (seq s))
1
2
3
#'user/t
user> 

Again that notwithstanding drop could be optimised to save a wrapping 
lazy-seq object in the case we call drop with 0. But that again is an 
optimisation, not a bug. An implementation could look like this:

(defn drop+
  [n coll]
  (if (pos? n)
(lazy-seq (drop+ (dec n) (rest coll)))
coll))

In general lookahead is not debatable. A sequence function which looks 
further ahead then absolutely necessary to perform its function is broken.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.