Lenses in Julia
Certain aspects of this me of the modf macro for Common Lisp:
https://github.com/smithzvk/modf
You use place syntax like what is used with incf or setf, denoting part of some complex object. But the modification is made to the corresponding part of a copy of the object, and the entire new object is returned.
Was hoping this was data lenses, like cambria from ink&switch
https://www.inkandswitch.com/cambria/
Not sure how "A Lens allows to access or replace deeply nested parts of complicated objects." is any different from writing a function to do the same?
Julia curious, very little experience
I have to admit I don’t really understand the point of doing this instead of just obj.a = 2 or whatever.
Guys, What's you're opinion on Julia?
I am thinking of using it for data science work.
Any draw backs? or advantages I should know about?
Is Julia a general purpose programming language? I mean I did check the web site which contains a "General Purpose" section, yet the articles seem to center around "scientific applications".
Is this like setf in lisp?
Nice to see this passed around on Hacker News. I think the whole concept of lenses is super cool and useful, but suffered from the usual Haskellificiation problems of being presented in an unnecessarily convoluted way.
I think Accessors.jl has a quite nice and usable implementation of lenses, it's something I use a lot even in code where I'm working with a lot of mutable data because it's nice to localize and have exact control over what gets mutated and when (and I often find myself storing some pretty complex immutable data in more 'simple' mutable containers)