Confusing Regex Behavior

2018-12-04 Thread Randy J. Ray
I must be doing something wrong here, but I cannot figure this out.

The following results in "nil" from re-matches:

(re-matches #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)" "[1518-05-27
00:42] falls asleep\n")

This, however, properly matches the line and produces the backreferences:

(re-find (re-matcher #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)"
"[1518-05-27 00:42] falls asleep\n"))

I've used re-matches many times, but this has me stumped. This is behaving
this way on both 1.8.0 and 1.9.0.

Randy
-- 
Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
Silicon Valley Scale Modelers: http://www.svsm.org
Sunnyvale, CA

-- 
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: Confusing Regex Behavior

2018-12-04 Thread Andy Fingerhut
The doc string for re-matches says that it
uses java.util.regex.Matcher.matches().  The Java doc page for the class
java.util.regex.Matcher [1] says "The matches

method
attempts to match the entire input sequence against the pattern."

The doc string for re-find says that it
uses java.util.regex.Matcher.find().  On [1] you can find the statement "
The find

method
scans the input sequence looking for the next subsequence that matches the
pattern."

I haven't dug into your regex and string in detail, but most likely what is
happening is that the regex matches part of the string, but it doesn't
match the _entire_ string.

Andy

[1] https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html




On Tue, Dec 4, 2018 at 11:16 AM Randy J. Ray  wrote:

> I must be doing something wrong here, but I cannot figure this out.
>
> The following results in "nil" from re-matches:
>
> (re-matches #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)" "[1518-05-27
> 00:42] falls asleep\n")
>
> This, however, properly matches the line and produces the backreferences:
>
> (re-find (re-matcher #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)"
> "[1518-05-27 00:42] falls asleep\n"))
>
> I've used re-matches many times, but this has me stumped. This is behaving
> this way on both 1.8.0 and 1.9.0.
>
> Randy
> --
> Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
> Silicon Valley Scale Modelers: http://www.svsm.org
> Sunnyvale, CA
>
> --
> 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.
>

-- 
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: Confusing Regex Behavior

2018-12-04 Thread Randy J. Ray
Oh, that might be it. The newline at the end of the string might be what is
throwing a wrench into things. Though, to be fair, when I used re-matches
yesterday the newline wasn't an issue.

Nonetheless, I can work with re-find/re-matcher for now.

On Tue, Dec 4, 2018 at 11:28 AM Andy Fingerhut 
wrote:

> The doc string for re-matches says that it
> uses java.util.regex.Matcher.matches().  The Java doc page for the class
> java.util.regex.Matcher [1] says "The matches
> 
>  method
> attempts to match the entire input sequence against the pattern."
>
> The doc string for re-find says that it
> uses java.util.regex.Matcher.find().  On [1] you can find the statement "
> The find
> 
>  method
> scans the input sequence looking for the next subsequence that matches the
> pattern."
>
> I haven't dug into your regex and string in detail, but most likely what
> is happening is that the regex matches part of the string, but it doesn't
> match the _entire_ string.
>
> Andy
>
> [1] https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html
>
>
>
>
> On Tue, Dec 4, 2018 at 11:16 AM Randy J. Ray  wrote:
>
>> I must be doing something wrong here, but I cannot figure this out.
>>
>> The following results in "nil" from re-matches:
>>
>> (re-matches #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)" "[1518-05-27
>> 00:42] falls asleep\n")
>>
>> This, however, properly matches the line and produces the backreferences:
>>
>> (re-find (re-matcher #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)"
>> "[1518-05-27 00:42] falls asleep\n"))
>>
>> I've used re-matches many times, but this has me stumped. This is
>> behaving this way on both 1.8.0 and 1.9.0.
>>
>> Randy
>> --
>> Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
>> Silicon Valley Scale Modelers: http://www.svsm.org
>> Sunnyvale, CA
>>
>> --
>> 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.
>>
> --
> 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.
>


-- 
Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
Silicon Valley Scale Modelers: http://www.svsm.org
Sunnyvale, CA

-- 
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: Confusing Regex Behavior

2018-12-04 Thread Justin Smith
You don't need to use re-matcher in that example - the output of re-find
with the regex and the string is identical. If you are using the matcher to
collect a series of matches in one string, you can also uses re-seq which
returns a lazy-seq of the matches of your regex in the string.

On Tue, Dec 4, 2018 at 12:37 PM Randy J. Ray  wrote:

> Oh, that might be it. The newline at the end of the string might be what
> is throwing a wrench into things. Though, to be fair, when I used
> re-matches yesterday the newline wasn't an issue.
>
> Nonetheless, I can work with re-find/re-matcher for now.
>
> On Tue, Dec 4, 2018 at 11:28 AM Andy Fingerhut 
> wrote:
>
>> The doc string for re-matches says that it
>> uses java.util.regex.Matcher.matches().  The Java doc page for the class
>> java.util.regex.Matcher [1] says "The matches
>> 
>>  method
>> attempts to match the entire input sequence against the pattern."
>>
>> The doc string for re-find says that it
>> uses java.util.regex.Matcher.find().  On [1] you can find the statement "
>> The find
>> 
>>  method
>> scans the input sequence looking for the next subsequence that matches the
>> pattern."
>>
>> I haven't dug into your regex and string in detail, but most likely what
>> is happening is that the regex matches part of the string, but it doesn't
>> match the _entire_ string.
>>
>> Andy
>>
>> [1]
>> https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html
>>
>>
>>
>>
>> On Tue, Dec 4, 2018 at 11:16 AM Randy J. Ray  wrote:
>>
>>> I must be doing something wrong here, but I cannot figure this out.
>>>
>>> The following results in "nil" from re-matches:
>>>
>>> (re-matches #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)" "[1518-05-27
>>> 00:42] falls asleep\n")
>>>
>>> This, however, properly matches the line and produces the backreferences:
>>>
>>> (re-find (re-matcher #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)"
>>> "[1518-05-27 00:42] falls asleep\n"))
>>>
>>> I've used re-matches many times, but this has me stumped. This is
>>> behaving this way on both 1.8.0 and 1.9.0.
>>>
>>> Randy
>>> --
>>> Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
>>> Silicon Valley Scale Modelers: http://www.svsm.org
>>> Sunnyvale, CA
>>>
>>> --
>>> 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.
>>>
>> --
>> 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.
>>
>
>
> --
> Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
> Silicon Valley Scale Modelers: http://www.svsm.org
> Sunnyvale, CA
>
> --
> 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.
>

-- 
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 

Re: GraalVM's native-image incompatible with Clojure's eval?

2018-12-04 Thread Khalid Jebbari
Thanks a lot for the links. Indeed it seems that parts of Clojure inevitably 
end up using reflections unless anotated.

-- 
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] com.walmartlabs/schematic 1.2.0

2018-12-04 Thread Howard Lewis Ship
Schematic is a Clojure library which aids in assembling Component systems
from configuration data.

* Expects components to implement the Component/Lifecycle protocol
* Prefers pure data for declaring dependencies
* Provides a simple mechanism for assembling/starting just a subset of
Components
* Avoids the pattern of passing a large bag of config data through down
through levels of Component creation functions

https://github.com/walmartlabs/schematic

New in release 1.2.0:

- Utilities to transform the configuration before assembling the system map
- Improvements to errors related to unknown component references
- Allows for Java objects as components

-- 
Howard M. Lewis Ship

Senior Mobile Developer at Walmart Labs

(971) 678-5210
http://howardlewisship.com
@hlship

-- 
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: Confusing Regex Behavior

2018-12-04 Thread Randy J. Ray
Oh, handy to know. Thanks.

(I come from a mostly Perl background, where regular expressions are
first-class objects and operations on/with them are baked in. The Java
approach to regexp that Clojure builds on is a little odd to me. But then,
Perl is more than a little odd to a lot of people...)

Randy

On Tue, Dec 4, 2018 at 1:37 PM Justin Smith  wrote:

> You don't need to use re-matcher in that example - the output of re-find
> with the regex and the string is identical. If you are using the matcher to
> collect a series of matches in one string, you can also uses re-seq which
> returns a lazy-seq of the matches of your regex in the string.
>
> On Tue, Dec 4, 2018 at 12:37 PM Randy J. Ray  wrote:
>
>> Oh, that might be it. The newline at the end of the string might be what
>> is throwing a wrench into things. Though, to be fair, when I used
>> re-matches yesterday the newline wasn't an issue.
>>
>> Nonetheless, I can work with re-find/re-matcher for now.
>>
>> On Tue, Dec 4, 2018 at 11:28 AM Andy Fingerhut 
>> wrote:
>>
>>> The doc string for re-matches says that it
>>> uses java.util.regex.Matcher.matches().  The Java doc page for the class
>>> java.util.regex.Matcher [1] says "The matches
>>> 
>>>  method
>>> attempts to match the entire input sequence against the pattern."
>>>
>>> The doc string for re-find says that it
>>> uses java.util.regex.Matcher.find().  On [1] you can find the statement "
>>> The find
>>> 
>>>  method
>>> scans the input sequence looking for the next subsequence that matches the
>>> pattern."
>>>
>>> I haven't dug into your regex and string in detail, but most likely what
>>> is happening is that the regex matches part of the string, but it doesn't
>>> match the _entire_ string.
>>>
>>> Andy
>>>
>>> [1]
>>> https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html
>>>
>>>
>>>
>>>
>>> On Tue, Dec 4, 2018 at 11:16 AM Randy J. Ray 
>>> wrote:
>>>
 I must be doing something wrong here, but I cannot figure this out.

 The following results in "nil" from re-matches:

 (re-matches #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)" "[1518-05-27
 00:42] falls asleep\n")

 This, however, properly matches the line and produces the
 backreferences:

 (re-find (re-matcher #"\[((\d+)-(\d+)-(\d+) (\d\d):(\d\d))\] (.*)"
 "[1518-05-27 00:42] falls asleep\n"))

 I've used re-matches many times, but this has me stumped. This is
 behaving this way on both 1.8.0 and 1.9.0.

 Randy
 --
 Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
 Silicon Valley Scale Modelers: http://www.svsm.org
 Sunnyvale, CA

 --
 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.

>>> --
>>> 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.
>>>
>>
>>
>> --
>> Randy J. Ray - randy.j@gmail.com - twitter.com/rjray
>> Silicon Valley Scale Modelers: http://www.svsm.org
>> Sunnyvale, CA
>>
>> --
>> 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 t

RE: [ANN] Clojure 1.10.0-RC3

2018-12-04 Thread Sean Corfield
We have 1.10 RC 3 in production. So far, so good.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com  on behalf of Sean 
Corfield 
Sent: Monday, December 3, 2018 4:13:10 PM
To: Clojure
Subject: Re: [ANN] Clojure 1.10.0-RC3

Our full test suite passes with 1.10 RC 3 at World Singles Networks.

This will go into our next production build, some time this week (possibly 
tomorrow).

On Monday, December 3, 2018 at 8:19:25 AM UTC-8, Alex Miller wrote:
1.10.0-RC3 is now available.

You can try it with clj using:

clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-RC3"}}}'

Changes in 1.10.0-RC3:

  *   CLJ-2447 - clojure.datafy 
docstring is missing
  *   CLJ-2448 - change name of 
async-require to serialized-require

You can read the full 1.10 changelog here: 
https://github.com/clojure/clojure/blob/master/changes.md

--
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.

-- 
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: Confusing Regex Behavior

2018-12-04 Thread Matching Socks
See also Java's regex "Comparison to Perl 5" at 
https://docs.oracle.com/javase/9/docs/api/java/util/regex/Pattern.html.  

However, you are in for a treat!  Perl is insanely great.  Clojure is 
simply great.

-- 
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: [ANN] 'Elements of Clojure' is complete

2018-12-04 Thread Daniel Bell
Hey, glad to hear it.  Excited to read the completed version over the 
holidays.

On Sunday, December 2, 2018 at 4:25:42 PM UTC-7, Zach Tellman wrote:
>
> I'm very happy to announce, only two and a half years after the release of 
> the first chapter, that Elements of Clojure is completely finished.  
> Further details can be found here: 
> https://groups.google.com/forum/#!topic/elements-of-clojure/UUJjqU1rllU.
>
> If you've never heard of the book before, please check out its website: 
> http://elementsofclojure.com/
>
> Zach
>

-- 
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.