Fork me on GitHub
#clojure
<
2015-11-08
>
sandbags10:11:56

In the leiningen docs it says "Profiles specified in profiles.clj will override profiles in project.clj” my experience is that this is quite literal, i.e. it doesn’t just override by values specified in profiles.clj but the presence of profiles.clj means the corresponding section in project.clj is ignored. Anyone know if this should be how it works?

sandbags11:11:39

for example my dependencies in project.clj :profiles section are ignored while profiles.clj is present (and without those dependencies)

pesterhazy11:11:54

@sandbags: that's not how it should work

pesterhazy11:11:05

dependencies should be additive

sandbags11:11:09

@pesterhazy: it did seem a bit odd to me

sandbags11:11:13

i wonder what is causing it

pesterhazy11:11:32

can you show you profiles.clj?

sandbags11:11:45

with some editing

pesterhazy11:11:19

lein actually allows you to specify how keys should be merged if they are present in multiple profiles: https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md

pesterhazy11:11:37

but for dependencies it should definitely do the right thing by default

sandbags11:11:11

unfortunately thinking this is how it worked i moved everything from project.clj :profiles into profiles.clj

sandbags11:11:25

thanks yes, i have pprint

pesterhazy11:11:32

well, pprint should make it obvious where the error is

sandbags11:11:54

I’m not sure what you mean

pesterhazy11:11:01

if profiles.clj overrides your project.clj, there must be a typo/error somewhere. With pprint you should be able to experiment to see where it is

sandbags11:11:26

the point surely is that it’s mean to override it

sandbags11:11:33

but, as you say, additively

sandbags11:11:57

i’m not clear how :dependencies as a key can get lost when it wasn’t specified in profiles.clj at all

sandbags11:11:33

but at least now that I know that it’s meant to work how i expected, i can hunt for the problem. thank you

pesterhazy11:11:03

you're welcome

sandbags11:11:46

yes now i see what you mean, just took a different way of looking at it … i can see the problem

sandbags11:11:07

when profiles.clj exists the :dependencies from the :profiles section of project.clj do not get copied into the main :dependencies

sandbags11:11:23

when it does not exist, they do

mikera14:11:14

Hi all, for a little fun this weekend I made a Clojure library that allows you to encode videos and used it to create some procedural animations. Hope you find it interesting! https://www.youtube.com/watch?v=XKV209VfkTk

danielsu14:11:03

Hi. Is it possible to create a custom type with either deftype or defrecord and extend it in such a way that i could be cast to a numerical value? So it could for example be used like this: (+ 1 myrecord)

bronsa15:11:44

@danielsu: no. Number is a class, not an interface and you can't extend deftypes/defrecords to a class

danielsu15:11:39

@bronsa ok i see. Thanks for clarifying that.

benedek18:11:24

hi, any known ways you gals/guys aware to get all the protocols defined by a given namespace?

bronsa18:11:46

(->> your-ns ns-publics (filter (comp :method-builders deref val)) (map val))

benedek19:11:19

i was digging around ns-publics but have not found enlightenment...

twillis19:11:16

anyone have any like using the like operator wildcard with honeysql?

["SELECT DISTINCT artist_canonical AS id, artist AS name FROM tracks WHERE (id like ?) ORDER BY id " "%"]
works
["SELECT DISTINCT artist_canonical AS id, artist AS name FROM tracks WHERE (id like ?) ORDER BY id " "a%"]
does not

twillis19:11:07

and I have data in there....

[ {:id "a guy called gerald", :name "A Guy Called Gerald"} {:id "a minor forest", :name "A Minor Forest"} {:id "a present day nightmare", :name "A PRESENT DAY NIGHTMARE"} {:id "aavikko", :name "Aavikko"} {:id "abiodun oyewole", :name "Abiodun Oyewole"} {:id "able baker fox", :name "Able Baker Fox"} {:id "abscess", :name "Abscess"} {:id "abysmal dawn", :name "Abysmal Dawn"} {:id "ac dc", :name "AC DC"} {:id "ac/dc", :name "AC/DC"} {:id "accept", :name "Accept"} {:id "adam and the ants", :name "Adam And The Ants"} {:id "adam ant", :name "Adam Ant"} {:id "adam west", :name "Adam West"} {:id "adebisi shank", :name "Adebisi Shank"} {:id "adolescents", :name "Adolescents"} {:id "adrenalin od", :name "Adrenalin OD"} {:id "adrenaline o.d.", :name "Adrenaline O.D."} {:id "aerosmith", :name "Aerosmith"} {:id "aesop rock", :name "Aesop Rock"} {:id "afghan whigs", :name "Afghan Whigs"} {:id "afx", :name "AFX"} {:id "agenda of swine", :name "Agenda of Swine"} {:id "agent orange", :name "Agent Orange"} {:id "agoraphobic nosebleed", :name "Agoraphobic Nosebleed"} {:id "akimbo", :name "Akimbo"} {:id "alabama thunderpussy", :name "Alabama Thunderpussy"} {:id "alcest", :name "Alcest"} {:id "alcest", :name "ALCEST"} {:id "alchemist", :name "Alchemist"} {:id "aldonova", :name "Aldonova"}]

thheller19:11:01

@twillis which database?

thheller19:11:22

postgresql you could use a regexp instead of like

thheller19:11:57

no idea then sry

twillis19:11:15

me neither lol

twillis19:11:22

well apparently it doesn't like the id as a field name for that.

twillis19:11:48

this works fine

["SELECT DISTINCT artist_canonical AS id, artist AS name FROM tracks WHERE artist_canonical LIKE ? ORDER BY id " "a%"]