off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
dpsutton 2021-02-05T07:12:43.081400Z

i just learned about clojure.tools.macro, in particular symbol-macrolet. I have an urge to overuse the heck out of this. a tasteful example: https://github.com/swannodette/logic-tutorial/blob/master/src/logic_tutorial/tut3.clj#L16

Gleb Posobin 2021-02-06T19:18:33.116700Z

I didn't get that example. What is it doing, what is lvar?

dpsutton 2021-02-06T19:54:15.118900Z

Lvar is a logical variable which is unbound. It can unify to anything.

Gleb Posobin 2021-02-06T19:54:37.119100Z

What's unify?

Max 2021-02-06T20:05:12.119300Z

Why doesn’t (let [_ (lvar)] …) work in this case?

dpsutton 2021-02-06T20:06:27.119500Z

it doesn't because then they are all the same lvar. but rather than write (== [(lvar) (lvar) [(lvar) (lvar) 'milk (lvar) (lvar)] (lvar) (lvar)] hs) he made a macro that the form _ expands to (lvar)

dpsutton 2021-02-06T20:07:39.119700Z

(macroexpand
  '(macro/symbol-macrolet [_ (lvar)]
                          (all
                            (== [_ _ [_ _ 'milk _ _] _ _] hs)                         
                            (firsto hs ['norwegian _ _ _ _])                         
                            (nexto ['norwegian _ _ _ _] [_ _ _ _ 'blue] hs)       
                            (righto [_ _ _ _ 'ivory] [_ _ _ _ 'green] hs)         
                            (membero ['englishman _ _ _ 'red] hs)                    
                            (membero [_ 'kools _ _ 'yellow] hs)                      
                            (membero ['spaniard _ _ 'dog _] hs)                      
                            (membero [_ _ 'coffee _ 'green] hs)                      
                            (membero ['ukrainian _ 'tea _ _] hs)                     
                            (membero [_ 'lucky-strikes 'oj _ _] hs)                  
                            (membero ['japanese 'parliaments _ _ _] hs)              
                            (membero [_ 'oldgolds _ 'snails _] hs)                   
                            (nexto [_ _ _ 'horse _] [_ 'kools _ _ _] hs)          
                            (nexto [_ _ _ 'fox _] [_ 'chesterfields _ _ _] hs))))
(do
 (all
  (==
   [(lvar) (lvar) [(lvar) (lvar) 'milk (lvar) (lvar)] (lvar) (lvar)]
   hs)
  (firsto hs ['norwegian (lvar) (lvar) (lvar) (lvar)])
  (nexto
   ['norwegian (lvar) (lvar) (lvar) (lvar)]
   [(lvar) (lvar) (lvar) (lvar) 'blue]
   hs)
  (righto
   [(lvar) (lvar) (lvar) (lvar) 'ivory]
   [(lvar) (lvar) (lvar) (lvar) 'green]
   hs)
  (membero ['englishman (lvar) (lvar) (lvar) 'red] hs)
  (membero [(lvar) 'kools (lvar) (lvar) 'yellow] hs)
  (membero ['spaniard (lvar) (lvar) 'dog (lvar)] hs)
  (membero [(lvar) (lvar) 'coffee (lvar) 'green] hs)
  (membero ['ukrainian (lvar) 'tea (lvar) (lvar)] hs)
  (membero [(lvar) 'lucky-strikes 'oj (lvar) (lvar)] hs)
  (membero ['japanese 'parliaments (lvar) (lvar) (lvar)] hs)
  (membero [(lvar) 'oldgolds (lvar) 'snails (lvar)] hs)
  (nexto
   [(lvar) (lvar) (lvar) 'horse (lvar)]
   [(lvar) 'kools (lvar) (lvar) (lvar)]
   hs)
  (nexto
   [(lvar) (lvar) (lvar) 'fox (lvar)]
   [(lvar) 'chesterfields (lvar) (lvar) (lvar)]
   hs)))

Max 2021-02-06T20:08:11.119900Z

Aaaah, makes sense

dpsutton 2021-02-06T20:09:48.120100Z

@posobin unify means to unify the meaning of a logical variable. (unify (A 3) (2 3)) would unify the logical variable A with 2. I made up the signature of unify here but that's the general idea

👍 1
1
caumond 2021-02-05T07:31:02.081600Z

the real question is, are they any customer looking for that features: code quality in their IOT.....

caumond 2021-02-05T07:33:50.081800Z

I'm not sure you're fan about uncle bob there, but I was really struck by his proposal in one you tube video to go to the build of a corporation of development. Like doctors, lawyers have. His position, was close to yours @noisesmith: with the time, software will be everywhere. The day when a dramatic event will occur, with too much people dying because of software, there will be two possibilities: either developpers will have created that corporation, it will be reinforced, either lawyers will add a lot of regulatory constraints to them.

2021-02-05T12:26:51.083600Z

I have 2 screens on our customers system that are meant to show the same data, they don't. It doesn't match up all the time. I asked what I thought was a simple question, "which one is wrong?". "Don't know". Ok, I'll rephrase, for the current settings... What is the correct vlaues that should be shown? "Don't know." ".... Do you see my problem?" "It needs fixed." "Yes, it does, but how am I supposed to fix it if I don't know what the values to be displayed actually are or what one is wrong (they could be both be wrong)." "It needs fixed."

😀 1
2021-02-05T12:28:15.084Z

and the SQL behind both of them is wildly different, and both equally impenetrable.

🤦 2
🙂 1
caumond 2021-02-05T12:31:18.085Z

A problem well defined is a problem half solved. Henri Poincarré. It seems you're not there !

3
2021-02-05T12:34:59.087Z

When the work request is “I don’t know what I want,” then “I don’t know how to do that” is a valid implementation.

😄 2
2021-02-05T12:36:24.087400Z

I want to scribble that all over the people I work withs faces with permanent marker

😆 2
2021-02-05T12:37:50.087800Z

I know that feeling.

caumond 2021-02-05T12:38:04.088100Z

it's my day to day

caumond 2021-02-05T12:38:40.088900Z

one step deeper @qmstuart, I have guys matching your description AND not agreeing with my solution.

dgb23 2021-02-05T12:42:06.092Z

There seems to be a DRY violation. Two separate things (SQL queries) represent the same knowledge.

dgb23 2021-02-05T12:43:28.093400Z

Sometimes you can tackle the problem by disentangling and the original intent (and bug) becomes clear.

dgb23 2021-02-05T12:45:32.094500Z

In your case it seems you need to do that. So take it as a fun puzzle 😂

Tomas Brejla 2021-02-05T13:21:08.095200Z

... but DID YOU FIX IT? 😄

2021-02-05T13:21:33.095400Z

If by fix, you mean I went and made a cheese toastie, then yes.

👏 1
orestis 2021-02-05T15:35:58.097400Z

Hi there, this is considered spam for a few reasons: • wrong channel • no obvious links with Clojure

➕ 2
2021-02-05T15:58:58.097800Z

wait, so it was an on-topic post? 😆

Mike 2021-02-05T16:05:21.098100Z

It's interesting that posts in #off-topic have to be in a way on-topic.

2021-02-05T16:25:07.098300Z

I smell a Monty Python skit

souenzzo 2021-02-05T19:54:52.100300Z

breaking news: clojure isn't a superset of edn: '1 is a valid symbol in edn But in clojure it is (quote 1)

borkdude 2021-02-05T19:57:17.101100Z

' is a valid symbol in EDN, also '1 whereas in Clojure this is expanded into the special form (quote 1)

borkdude 2021-02-05T19:57:40.101500Z

not sure if it's intended that symbols can start with a quote in EDN though

2021-02-05T20:20:38.102100Z

of course (symbol "'1") works

2021-02-05T20:29:21.102600Z

also 'foo/'1