From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.user Subject: dynamic-wind Date: Fri, 30 Jun 2017 22:33:02 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1498854822 2637 195.159.176.226 (30 Jun 2017 20:33:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Jun 2017 20:33:42 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 30 22:33:38 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dR2bd-00005k-OJ for guile-user@m.gmane.org; Fri, 30 Jun 2017 22:33:33 +0200 Original-Received: from localhost ([::1]:45876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR2bf-0008Sr-U8 for guile-user@m.gmane.org; Fri, 30 Jun 2017 16:33:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR2bC-0008SX-Vr for guile-user@gnu.org; Fri, 30 Jun 2017 16:33:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dR2bC-0002l9-3U for guile-user@gnu.org; Fri, 30 Jun 2017 16:33:06 -0400 Original-Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:36560) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dR2bB-0002iT-RZ for guile-user@gnu.org; Fri, 30 Jun 2017 16:33:06 -0400 Original-Received: by mail-wm0-x22d.google.com with SMTP id 62so119755670wmw.1 for ; Fri, 30 Jun 2017 13:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=amSJr78/uvXoT6nvqzyXDG8Zsrvc5ySSWh6JzFvqgJ0=; b=TKK2NIKt7O89WjxgY6pJyUb8PKlaYSqZ9BUv3s6WMn259/fsUvGn5A8F/PN6vS0IXK lzaWcBiVAmHueOmlj4wO4kwLFDDEb/Qc4VSpU01oMrEOWFZCrMhDPsXuGfbh3P0Hil1D ZM6x4B8J/e46TayoB47VGXrsFjgeXicXtl6L3fNR0Gi1pGNt1BfzJ+cFwx6ID4N/pEF3 TX+B7LtYKEWaNjM3skIzt3qYHz2acJzqiy5G6JWHSH1fRBnC4pdHx8Satv1tVqLHBVQi gaVkZsS3S9y43iRpR3Bf+PeFuifJEKbhn2fzYABVw8vMux+mtHY293WlE1YKwxB6Vt35 cP3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=amSJr78/uvXoT6nvqzyXDG8Zsrvc5ySSWh6JzFvqgJ0=; b=ck5M1ZEKFHOCiqHGge8bX9RLMhfqDNpWETUdrchjRtRpEJEgnEnZItdy0A30xTZsJB SuuUeaJR0g1x/CeMC9fP9TpdWzhkMUYrP0h++vBSeKtmIcRg+isfwZalmfmksUXtQMpb snksdubA/X6PY4r0EtPvn7loIYnmtKvWn6gsD64Cg3jfBrOhR0aparfBKfAjgRduWU2c cIsNSEphCHeOW9xBApb8WCQ3LrFifP897KDVFctReEIk067F5lcodQcTMC3K+JWoOERq j8ErixaCL8MsVySknhg0CvQmlidtrZZbpCwJ/vCZ4cG5IpkED0Uvds/yws7ynvk9aBO9 VScA== X-Gm-Message-State: AKS2vOzVwkQ67JzVVKt1QoMvJNC+yvm04Pcn5E7iCmowxAMR+XOE1oBz TExMx1cziDKmX9YnHOItrbGPdIAMHD5i X-Received: by 10.80.175.34 with SMTP id g31mr6661499edd.24.1498854782814; Fri, 30 Jun 2017 13:33:02 -0700 (PDT) Original-Received: by 10.80.131.4 with HTTP; Fri, 30 Jun 2017 13:33:02 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.user:13890 Archived-At: On the irc channel I was suggested that it might have been a good fit for my use case I took a look at it in the manual I'm perplexed. I don't understand it How is it supposed to be used ? The provided example is somewhat contrived, I couldn't understand it anyway. My use case is basic, really. I have a scheme wrap around a C library for reading xls files, freexl. Freexl uses a pointer to a structure tha represents the opened xls file and its contents Each function writes/reads in the memory region pointed to such pointer. In the end, it requires to use a function that closes the file AND frees all the involved structures in memory. So my idea was that I would have gotten a simple macro, like this (with-xls-file "path/to/my/xls-file.xls" handler-ptr (do-something handler-ptr) (do-something-more handler-ptr)) and this would have expanded to (freexl-open "path/to/my/xls-file.xls" handler-ptr) (freexl-do-something handler-ptr) (freexl-do-something-more handler-ptr)) (freexl-close handler-ptr) Do I need dynamic-wind at all ?