Re: Frustrations so far

2016-07-22 Thread James Reeves
On 22 July 2016 at 16:42, Peter Romfeld  wrote:

>
>>
>>> Im frustrated with `empty?` throwing exceptions for Long and Keyword
>>>
>>
>> What should happen? Asking whether an integer or keyword is "empty?"
>> doesn't really make sense IMO, and if it doesn't make sense, it should
>> throw an exception.
>>
>
> well its a fn?... "?" ! i would only expect a boolean out of it, of course
> if you read doc and look implementation it makes sense what it does, i
> still think that a function called "empty?" should not throw up, if its an
> Number or Keyword its in my opinion not an empty value! (i understand that
> a Number or Keyword is not sequential.. but then call it "not-seq?")
>

I think your expectation is perhaps wrong in this case. Predicates should
throw an exception on invalid inputs. If you're passing a number or keyword
to `empty?` then there's an error in your code. Throwing an exception
rather than failing silently is absolutely the right thing to do.

The `empty?` function isn't particularly unusual in throwing exceptions.
`(pos? "foo")` will throw an error, as will `(> "foo" 1)`. If you pass an
input that doesn't make sense, then an exception should be thrown.

security features in most frameworks are just smoke and mirrors, functions
>>> that dont actually do what they should do...
>>>
>>
>> Do you have an example?
>>
>
> I dont want to make negative advertisement,  but its about csrf, and
> giving false sense of being taken care of for people who dont fully
> understand it
>

I maintain Ring-Anti-Forgery, so if it's anything to do with that, feel
free to raise a concern. Maybe the documentation can be improved.

- James

-- 
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: Frustrations so far

2016-07-22 Thread Peter Romfeld


On Saturday, July 23, 2016 at 12:01:40 AM UTC+8, raould wrote:
>
> Unfortunately, dynamically typed most often means what you are 
> experiencing, as far as I know. Python, JavaScript, Scheme, Lua, etc. all 
> have something like NPE that can happen at any random time, it feels like, 
> no?
>

im sorry i have little experience with other langs.. just learned the 
basics in python for scripting when i was still sysadmin.. then i did 
elixir for a short while.. and almost all of my developer time is in 
clojure.. 

-- 
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: Frustrations so far

2016-07-22 Thread Peter Romfeld
NPE is just so painful! most exceptions are not that easy to debug, would 
be cool if it could say from where the problem was initiated.. (well 
because most of the time i forget to print the stacktrace with 
`print-stack-trace `)

-- 
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: Frustrations so far

2016-07-22 Thread Raoul Duke
Unfortunately, dynamically typed most often means what you are experiencing, as 
far as I know. Python, JavaScript, Scheme, Lua, etc. all have something like 
NPE that can happen at any random time, it feels like, no?

-- 
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: Frustrations so far

2016-07-22 Thread Peter Romfeld
I dont wanna go into the problems we have with this "dynamic typesystem" 
where you would think it takes care of different types in different 
functions, but in the end you just get NullPointerExceptions and waste half 
a day figuring out from where it comes from

-- 
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: Frustrations so far

2016-07-22 Thread Peter Romfeld

>
>  
>
>> Im frustrated with `empty?` throwing exceptions for Long and Keyword
>>
>
> What should happen? Asking whether an integer or keyword is "empty?" 
> doesn't really make sense IMO, and if it doesn't make sense, it should 
> throw an exception.
>

well its a fn?... "?" ! i would only expect a boolean out of it, of course 
if you read doc and look implementation it makes sense what it does, i 
still think that a function called "empty?" should not throw up, if its an 
Number or Keyword its in my opinion not an empty value! (i understand that 
a Number or Keyword is not sequential.. but then call it "not-seq?") 

 
>
>> I had some issues understanding that maps of certain size are not in 
>> order anymore because of the underlying java functions and optimizations 
>>
>
> Maps are officially unordered. The fact that small maps are ordered is an 
> implementation detail (though one that I know trips up a lot of newcomers).
>

Yeah kinda hard to figure out, special if you have 0 Java background
 

>  
>
>> the api docs are almost useless! - to get the arrity and stuff.. wtf i 
>> still have no clue how to use this new function i never used before...
>>
>
> Do you have an example of a poorly documented function? Also, do you know 
> about https://clojuredocs.org/?
>

I dont remember right now and too lazy (it was something without community 
examples), and then you just see maybe a cryptic docstring and what 
arguments it accepts 

 
>
>> security features in most frameworks are just smoke and mirrors, 
>> functions that dont actually do what they should do...
>>
>
> Do you have an example?
>
 

>  
>
I dont want to make negative advertisement,  but its about csrf, and giving 
false sense of being taken care of for people who dont fully understand it

cheers,
peter

>

-- 
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: Does clojure.set/rename-keys work with namespace key?

2016-07-22 Thread Mamun
Please skip my last email. It is working. 

Br,
Mamun

On Friday, July 22, 2016 at 11:50:08 AM UTC+2, Mamun wrote:
>
> Hi
>
> Does clojure.set/rename-keys work with namespaced keys? 
>
>  (clojure.set/rename-keys {:fname "Musterman"} {:fname :person/fname})
> => #:person{:fname "Musterman"}
>
>
> Is it expected result? Why namespace as #:person? According to 
> documentation, it should return map. 
>
>
> Clojure version: [org.clojure/clojure "1.9.0-alpha10"]
>
> Br,
> Mamun
>
>
>
>
>
>
>

-- 
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: async-webinar vs. lein-cljsbuild vs nooby

2016-07-22 Thread hiskennyness


On Thursday, July 21, 2016 at 7:38:27 PM UTC-4, hiskennyness wrote:
>
> This cemo of channels in a web client works great.
>
>https://github.com/cognitect/async-webinar/blob/master/project.clj
>
> It uses plugin:
>
>   [lein-cljsbuild "1.0.4-SNAPSHOT"]
>
> While trying to extend the webinar with my Cells library 
> https://github.com/kennytilton/rube (which loads nicely from clojars  in 
> my mobile app framework Qxia (https://github.com/kennytilton/qxia)) 
> things were not going well so, looking for differences, I noticed that 
> Qxia's cljsbuild plugin is:
>
>   [lein-cljsbuild "1.1.3"]
>
> In the spirit of eliminating differences, I tried that plugin on 
> async-webinar and got errors:
>
> Exception in thread "main" java.io.FileNotFoundException: Could not locate 
>>> cljs/build/api__init.class or cljs/build/api.clj on classpath: , 
>>> compiling:(cljsbuild/compiler.clj:1:1)
>>
>>
>>
> I am not surprised because I *did* change something, but:
>
>1. Is that about right? I do have to stick to 1.0.4-SNAPSHOT?
>
> Yes and no. :) Yes if I am not going to upgrade all the other 
dependencies, no if I am (going to upgrade yada yada):

  :dependencies [[org.clojure/clojure "1.7.0"]
 [org.clojure/clojurescript "1.9.36"]
 [org.clojure/core.async "0.2.385"]
 [rube "0.1.0-SNAPSHOT"]]


  :plugins [[lein-cljsbuild "1.1.3"]]

lein cljsbuild is happy now, anyway.

 -kt


>1. I do not see where the webinar references "api" anything. Just 
>typical error noise?
>2. How daft am I for worrying about the lein-cljsbuild version before 
>anything else?
>
> -kt 
>
>   
>

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


Automat - order of reducing functions?

2016-07-22 Thread Andrew C
How come the order of the reducing operations in the resulting diagrams 
below is different?

Basically I want to call the first reducing operation after the first 1 and 
then the second operation when it accepts.

This is with [org.clojars.semperos/automat "0.2.0-alpha3"]

(ns p.core
  (:require [automat.core :as a])
  (:require [automat.viz :refer (save)]))

(def foo [1 (a/$ :start) (a/* 1) (a/$ :end)])
(def bar [1 (a/$ :i1)(a/* 1) (a/$ :i2) ])

(save (a/compile foo) "foo.png")
(save (a/compile bar) "bar.png")


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


Does clojure.set/rename-keys work with namespace key?

2016-07-22 Thread Mamun
Hi

Does clojure.set/rename-keys work with namespaced keys? 

 (clojure.set/rename-keys {:fname "Musterman"} {:fname :person/fname})
=> #:person{:fname "Musterman"}


Is it expected result? Why namespace as #:person? According to 
documentation, it should return map. 


Clojure version: [org.clojure/clojure "1.9.0-alpha10"]

Br,
Mamun






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