These are chat archives for Gozala/wisp

Mar 2015
Adam Avramov
Mar 02 2015 18:38
@Gozala: Yet another question -- any particular reason for this?
A pattern I liked about ClojureScript was being able to declare exported symbols from withing a let binding using def. Is there anything in particular which makes this behavior unfeasible for Wisp?
Adam Avramov
Mar 02 2015 18:53
Ah, looking at the 11 failing tests, it seems that some protocol code relies on that behavior -- otherwise some locals get exported.
Still, when you have the time, can you please spare a moment and let me know why you've decided to go with def used for declaring locals? :-)
Irakli Gozalishvili
Mar 02 2015 19:45
@egasimus analyzer at this poin isn’t smart enough to handle defsin let
@egasimus that line is to avoid exporting every def regardless of where it’s run into
@egasimus I’m not totally understanding a question, but if my guess is correct, then the reason is because making def export by default ended up exporting too much, but with some improvements to analyzer it actually could be advanced to export only things that needed to be.
@egasimus I think if I was starting with this toady it would have being different, current state is just a reflection of how parser analyzer etc.. have evolved
Adam Avramov
Mar 02 2015 21:20
@Gozala I'm not sure how/why the analyzer can't handle defs in let. It would basically be equivalent to setting something in exports from withing a normal JS closure, wouldn't it? What I don't understand is what other purpose could def serve if you already have let
Irakli Gozalishvili
Mar 02 2015 21:23
@egasimus analyzer does not currently carries much info about the depth of the scope
so if you have def with in a function you don’t wanna export that for example
@egasimus and if I’m not mistaken let itself expands to series of def’s in wisp
or at least used to
@egasimus I’m afraid I can’t recall all the issues, but there were planty if def was treated as export by default.
@egasimus not to say that can’t be fixed, it’s just yet another thing that would require some work
@egasimus also to be honest I never felt the pain of not having def with-in let so I never bothered fixing it.