From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jan Wielkiewicz Newsgroups: gmane.lisp.guile.user Subject: GOOPS and fibers - need help understanding what's wrong, bug in fibers/guile? Date: Wed, 22 Jul 2020 01:56:53 +0200 Message-ID: <20200722015653.630db7f9@interia.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36416"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Jul 22 02:02:34 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jy2DS-0009OM-8A for guile-user@m.gmane-mx.org; Wed, 22 Jul 2020 02:02:34 +0200 Original-Received: from localhost ([::1]:36456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jy2DR-0005iQ-Ap for guile-user@m.gmane-mx.org; Tue, 21 Jul 2020 20:02:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jy2D9-0005i6-Jo for guile-user@gnu.org; Tue, 21 Jul 2020 20:02:16 -0400 Original-Received: from smtpo.poczta.interia.pl ([217.74.65.154]:58400) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jy2D7-0002wg-7W for guile-user@gnu.org; Tue, 21 Jul 2020 20:02:15 -0400 X-Interia-R: Interia X-Interia-R-IP: 89.64.43.25 X-Interia-R-Helo: Original-Received: from localhost (89-64-43-25.dynamic.chello.pl [89.64.43.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA for ; Wed, 22 Jul 2020 01:57:09 +0200 (CEST) X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1595375830; bh=M1cE4Gf2cOos0ocFq+slPvZ4E/QYPXKY4Vm+IhpSpag=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:Date:From:To:Subject: Message-ID:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Interia-Antivirus; b=RONTXY/skTWtlwOL0JvqeCNTSjhbLHmC2VXRHS2ewL6PxtdbhVXlkqLbRq3w3otW5 JBMaA3cFX6aC7b8X9XRhwA4UZQpAHVk2XVLEF0YFVRCCMYHpUxvbPOxDfRA1jccxIT 65jYxve+nOqTCZDHtQIJi9RP+NNG8rMb5tJHu4MY= Received-SPF: pass client-ip=217.74.65.154; envelope-from=tona_kosmicznego_smiecia@interia.pl; helo=smtpo.poczta.interia.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/21 19:57:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16713 Archived-At: Hello, I started writing my project in Guile with GOOPS and fibers (I'll release it once it stops being a shame and starts working!), but I encountered a problem: The example from fibers' manual doesn't work: (lambda () (spawn-fiber (lambda () (display "hey!\n"))))) It doesn't print "hey" as documented in the manual. I use guile 3.0.4 and fibers 1.0.0 (from Guix). I also tried making a simple proof of concept, but it doesn't seem to do anything. I would like to understand what's wrong with my code or report a bug, if this is the case. No errors, warnings, syntax errors, just silence. My code: (define-module (blocks block) #:use-module (fibers) #:use-module (fibers channels) #:use-module (oop goops) #:use-module (srfi srfi-9) ;; records #:export ( connect-peers send-message handle-message start-listening)) (define-class () (input #:init-form '() #:getter get-input #:setter set-input #:init-keyword #:input) (output #:init-form '() #:getter get-output #:setter set-output #:init-keyword #:output)) ;; Only connection, no messaging started. (define-method (connect-peers (p1 ) (p2 )) (let ((p1-p2 (make-channel)) ;; p1 to p2 (p2-p1 (make-channel))) ;; p2 to p1 (set-input p1 p2-p1) (set-output p1 p1-p2) (set-input p2 p1-p2) (set-output p2 p2-p1))) (define-method (send-message (p ) msg) (put-message (get-output p) msg)) (define-method (handle-message (p )) (let loop () (define msg (get-message (get-input p))) (match (pk msg) ('ping (send-message p 'pong))) (loop))) (define-method (start-listening (p1 ) (p2 )) (run-fibers (lambda () (spawn-fiber (lambda () (connect-peers p1 p2) (handle-message p1) (send-message p1 'ping) (handle-message p2)))))) I run this in repl: (define p1 (make )) (define p2 (make )) (start-listening p1 p2) ----- Thanks in advance, Jan Wielkiewicz