Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Read again....

4 views
Skip to first unread message

Ramine

unread,
Dec 2, 2016, 2:56:57 PM12/2/16
to
Hello..........

About functional programming and object oriented programming..

I have continued to read about Lisp and Haskel functional languages,
and i have finally understood functional programming, in Lisp and
Haskel the functions are pure , that means that they don't use or call
global variables, but when you want to do mutability, you have
,like in message passing, to pass the local variable to an Mvar
in Haskel, it's like a queue, where the other threads must grap
this local variable and copy it in a local variable and
change it and put back this local variable in the queue for the other
threads to change it, so you will avoid race conditions in parallel
programming with this mechanism, but Mvar or the queues are still prone
to Deadlock or starvation. I have learned Lisp and Haskel and i have
noticed that to avoid the readability problem that i have spook about in
my previous post you have to decompose the many brackets with the defun.

In object oriented programming you can implement the Mvar of Haskel with
queues and you can avoid this way the problem of race conditions.


Thank you,
Amine Moulay Ramdane.




0 new messages