From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Thompson Newsgroups: gmane.lisp.guile.user Subject: Re: A couple of questions about goops method parameters Date: Fri, 05 Sep 2014 15:55:28 -0400 Message-ID: <87vbp1q1u7.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> References: <1409905923.9245.5.camel@Renee-desktop.suse> <871trpridm.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409946964 28904 80.91.229.3 (5 Sep 2014 19:56:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Sep 2014 19:56:04 +0000 (UTC) Cc: Carlos Pita , "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Sep 05 21:55:59 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XPzby-0004oy-FF for guile-user@m.gmane.org; Fri, 05 Sep 2014 21:55:58 +0200 Original-Received: from localhost ([::1]:59962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPzby-0004nw-4E for guile-user@m.gmane.org; Fri, 05 Sep 2014 15:55:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPzbl-0004n0-Dd for guile-user@gnu.org; Fri, 05 Sep 2014 15:55:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPzbb-0007dg-6w for guile-user@gnu.org; Fri, 05 Sep 2014 15:55:45 -0400 Original-Received: from na3sys009aog132.obsmtp.com ([74.125.149.250]:60010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPzba-0007dL-VA for guile-user@gnu.org; Fri, 05 Sep 2014 15:55:35 -0400 Original-Received: from mail-qg0-f50.google.com ([209.85.192.50]) (using TLSv1) by na3sys009aob132.postini.com ([74.125.148.12]) with SMTP ID DSNKVAoVNOac8/qIQ0AHLA+KnMmH11M677KL@postini.com; Fri, 05 Sep 2014 12:55:34 PDT Original-Received: by mail-qg0-f50.google.com with SMTP id q108so12062042qgd.37 for ; Fri, 05 Sep 2014 12:55:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=cpNP0lEZ4Bd54O26AIdvEo4FGe5CwMCgRjy/Ft0tsJw=; b=BGJFrKwUarQwktDEoe+OaGeKaTzAtbQ6DGrOALPKt3aSZS2OjZuNcbb4dLXmFyBhz3 60wKsIoqLZ3qQXxLevWFUs3WyPoeEAbTo1DRnYDawbwqvkEjUn45cm0766ezUeRdCP8/ 4PepsVCourkAXl+qhINt96erP4oAvn0pnvV9A7qBjkBmJJZzkk18pcMVVzfPR+OsYL6l Yn1Jm8+bvLoEqk8mPKboJvlTsTzm7k/BO3DKPCi8ESt9nPP5E1i/xRDzMOYulAc3JPCG /fzzxhe+QZgq+NnDWS7duam2gydwnVYmxcPSlYwyldr2FgMaogNIZP/VP2Dr8UQSGgo6 /h2A== X-Gm-Message-State: ALoCoQkDYweNfxHHlO3bH/7mPj7AoQvbBCTGxItCmKCaUYS498ARgtKPL14288LkTAt8/9I2AkZ8mcdyihjVKLSvV4SqrWK/UN82aPh0sFr8HKvCo9AzONIVbIF8S7LWf8iu78WOzlqI1c5YeVsJyPWcPNUanpK0Hw== X-Received: by 10.224.37.134 with SMTP id x6mr22232018qad.39.1409946931012; Fri, 05 Sep 2014 12:55:31 -0700 (PDT) X-Received: by 10.224.37.134 with SMTP id x6mr22232006qad.39.1409946930929; Fri, 05 Sep 2014 12:55:30 -0700 (PDT) Original-Received: from izanagi (209-6-40-86.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com. [209.6.40.86]) by mx.google.com with ESMTPSA id a62sm1523603qga.21.2014.09.05.12.55.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Sep 2014 12:55:30 -0700 (PDT) In-Reply-To: User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 74.125.149.250 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11462 Archived-At: Panicz Maciej Godek writes: > 2014-09-05 21:12 GMT+02:00 David Thompson : >> Panicz Maciej Godek writes: >>> >>> So perhaps you could tell me how to design a GUI framework in FP and >>> without OOP. To me it seems that GUI is the main domain the OOP was >>> crafted for, but if you have some nice functional ideas, perhaps you >>> could help me to redesign my framework. >>> >> >> Are you familiar with functional reactive programming? >> >> http://elm-lang.org/learn/What-is-FRP.elm >> >> Using FRP, we can model with mutable state in a pure, functional way. >> That is, the necessary mutation is hidden behind the runtime of the FRP >> implementation. >> >> Just some food for thought. > > Sure, I've been reading a lot, but I didn't manage to get much of it. > I mean, the toy examples are really nice, but it's hard for me to see > the advantage of FRP over OOP in practical systems (e.g. windowed > applications with buttons and so on). Although I see value in > encapsulating state mutations, the notion of state seems inevitable in > describing such applications (like the mere fact that a checkbox can > be checked or not -- so it's a state which is a part of the > description). > Yes, it's state, and state will always be there in a realtime application. However, you can still model it in a functional way with procedures that are idempotent and objects that are immutable. You just need to glue it all together with something that tracks the current state of the application. > BTW I recently ran into a problem with your signal propagation > framework from (guile 2d). Namely, if a signal is itself a mutable > object (like a vector or an array), then changing the value of that > object doesn't propagate (because it happens only when you use > slot-set!, and not (vector-set! (slot-ref ...)...)). > I can't find any workaround for that. I don't consider it a problem because the values stored signals are intended to be immutable. I will make that clear when I get around to documenting things better. If you mutate an object within the signal graph, bad things are bound to happen. The only reasonable side-effects are those that do not change values stored within signals, like writing to a log file or playing a sound. I have intentionally kept mutation at lowest layer of the system, abstracted away from the user. -- David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate