Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    In the "Static method calls" section
    Diva Martínez
    @zombiefungus
    ohh well, ok. I been reading the tutorial but missed that completly. I will check the book latter, thanks man
    Chris Double
    @doublec
    no worries
    Diva Martínez
    @zombiefungus
    i was a bit worried about if this would work with private methods, but it does.. so.. yeah, thanks a lot
    just pure curiosity, you said you have used Mozart since long enought
    what do you use it for?
    Chris Double
    @doublec
    I wrote some server side services in it - a bitcoin mining pool in the early days of bitcoin, and various support programs for it. I also used the Roads webserver.
    Diva Martínez
    @zombiefungus
    Honestly didn't know it was used outside academic/learning environments
    Chris Double
    @doublec
    I doubt it's been used much outside of that. I wanted to see what it was like to use in something though. It's a fun language to develop with.
    Diva Martínez
    @zombiefungus
    not sure if I would say fun haha but it sure is enlightening for understanding more about how programing langs are implemented
    happy with it
    Chris Double
    @doublec
    What are you using it for? Is it a course of some sort?
    Diva Martínez
    @zombiefungus
    yeah, but the course is new so students, professor, ta.. everyone is kinda learning the language from zero
    Chris Double
    @doublec
    Interesting choice of language - I wonder how it got picked if no one knows it
    What version of Mozart are you using?
    Diva Martínez
    @zombiefungus
    v2
    I know, not the best choice either
    we've already had issues with things that aren't implemented yet
    Chris Double
    @doublec
    Obscure programming language with a bleeding edge implementation. Someone likes torturing their students.
    Diva Martínez
    @zombiefungus
    so from now one we will be using v1.4
    Chris Double
    @doublec
    Yeah, I use 1.4 and 1.3.
    1.4 has bugs in the distributed support so I use 1.3 to avoid that.
    Diva Martínez
    @zombiefungus
    haha maybe, but thats also a professor that likes to suffer herself too. Everything she asks us to do, she do its herself, in more than one way
    thanks for the advice, I'll make sure she knows before the show goes on
    Chris Double
    @doublec
    Have fun :)
    Diva Martínez
    @zombiefungus
    thanks :) you will probably see me around again anytmoe soon, but next time I'll read the docs more carefully
    leaving for now, thanks again
    TotOrO
    @nikhilka08
    I'm trying to do exercise from the book "Concepts,techniques and model of computer programming" and for Chapter 1 Ex. 2 here is my code which gives me error "nesting marker expected as designator of nested function"
    Here is my code
    declare Fac S
     fun {Fac N}
           if N==0 then 1 else N*{Fac N-1} end
        end
    % {Browse {Fac 5} }
    
    declare fun {Mul N R} % For n*(n-1)*...*(n-r+1) 
           local S = N-R+1 in
              fun {Mul2 N S}
             if N==S then N else  N*{Mul2 N-1 S} end         
              end
           end
        end
    
    
    declare fun {Comb N R}
      if R==0 then 1 else  {Mul N R} div {Fac R} end
    end
    If someone can please help, i read about nesting marker but was not able to figure out how to use them
    Chris Double
    @doublec
    I don't understand the definition of Mul
    It seems to be returning a function called Mul2
    Did you expect something like:
    declare
    fun {Mul N R} % For n*(n-1)*...*(n-r+1) 
       local
          S = N-R+1
          fun {Mul2 N S}
             if N==S then N else  N*{Mul2 N-1 S} end         
          end
       in
          ..call Mul2 here..
       end
    end
    That's why you're getting the error btw, the nested function is messed up.
    TotOrO
    @nikhilka08
    @doublec It's a function to calculate Combination. I needed the first value of N so i saved it in S and made nested function. Formula it is calculating is (n*(n-1)*...*(n-r+1) ) / (r!) . And yes your answer is something I was expecting, thank you.
    TotOrO
    @nikhilka08
    have people here read CTM book?
    Stewart Mackenzie
    @sjmackenzie
    People here wrote CTM.
    Chris Double
    @doublec
    I still lurk - not many ask questions though
    I mostly use Mozart 1.3.x though
    Erlend Langseth
    @Ploppz
    Described my problem in an issue mozart/mozart2#322 the compiler doesn't work for me. Sorry for sharing this in several places but I first found the issues page, then I found the mailing list, and finally this Gitter :P
    Erlend Langseth
    @Ploppz
    it has been solved already ^^
    Chris Double
    @doublec
    Nice, quick response.
    Erlend Langseth
    @Ploppz
    How can I print booleans, integers or any value? Sort of a "debug print".
    Error messages are able to do this
    Chris Double
    @doublec
    {Show ....} should do it
    It'll output to the console, or emulator buffer in the emacs ide
    Erlend Langseth
    @Ploppz
    thanks!