From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Tai Newsgroups: gmane.lisp.guile.user Subject: dereferencing C pointer at scheme level Date: Sun, 12 May 2024 14:52:31 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="523"; 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 Sun May 12 23:53:35 2024 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 1s6H8Q-000AUP-Ml for guile-user@m.gmane-mx.org; Sun, 12 May 2024 23:53:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6H84-0004u8-UX; Sun, 12 May 2024 17:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6H83-0004se-7y for guile-user@gnu.org; Sun, 12 May 2024 17:53:11 -0400 Original-Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6H81-0000sd-DW for guile-user@gnu.org; Sun, 12 May 2024 17:53:10 -0400 Original-Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-de61424f478so3545140276.0 for ; Sun, 12 May 2024 14:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail-com.20230601.gappssmtp.com; s=20230601; t=1715550788; x=1716155588; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bL0D4kEnmCUdQna1UVCw9KDLMwWerXCPAEHZqNlTVac=; b=ksZPKyhAeglivuFATi9R1ivVyCJSCztmwysbs//jQWPyn0wyZQNlbfIjwtLuY62dWj AQVjS3aWLgTTdJnq+6otMUg+xfr/xx2dUXBRRKyKKAT4XpB3fJy+woydxVHm6KMazZr2 y3gqt5r4RH9jDHK74FGEQbkIy+CJfpgMaCAPd6KLuXTVRkbd9ZZojAN8yd/T+JWkQBRd JDmCWjw7qp5XiFXw2g+4+GVMzOjf1B/2ZlwK73EkIX5JFmsYykqZLPLoqBuTGurGPnGo U8AGn7Nk7rtiIW3DezVJ8c2d7WFhFsEu4b+OncqgF0VcUtJSCbkYe68tGepinavgwBdq NOjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715550788; x=1716155588; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bL0D4kEnmCUdQna1UVCw9KDLMwWerXCPAEHZqNlTVac=; b=nU1vKen3C3/5XedWrJNrH66tO90yk+E0sRBPj7RwoiRQc/x44gbocV+z6qzCNxe3+a BXPzebLLkE17dE10IICVpauHww4vKMPdE2zp2JADjLHUlmVQ3rNcVmgVnS4PJSoaKE2+ sON7Yj/LtkJJZF8Gtcyr4EP8zZX8HmM4q+TqTZfFDwbI08JoIRG+a/6X7flNkCafYGtJ wpTz8qZhPoowj2cUSzgExnI/U6ewD484HPvTfFh6Ufug/zjSlSdxEzqfVb3iEgkNq276 UBWWCubnjVT0muJJAgntyB/+e/GuGBH2u/OJU6cJ2Iq8cck9lpzoS9/AMt2sGWe5wkql RlCA== X-Gm-Message-State: AOJu0Yxb169cLLGQDCrt2tEdM5jEOKyIb0ZvLqLcsj2cRUuzjxFVOo/z uKlSnuU6KkrTTY28ZHjZW3pJmDFvzcotXkL2fdpx7ckcPPSgYHxo7Y34UPomrRWD/mMoQTJ9B08 vf9y5WtjM0P7lm9eZGZVTlvZyW2GFzkOw X-Google-Smtp-Source: AGHT+IEDuuKfDB5Dig9JNGCxvyNo11wg/y+ZRKWk1jww4SjsQkdNBYSHLXUIPivsbE8hiLq+nZ0ZKYN2+ilq2c2r4NE= X-Received: by 2002:a25:c714:0:b0:de4:5e5c:5efe with SMTP id 3f1490d57ef6-dee4f3720c8mr7415115276.47.1715550787891; Sun, 12 May 2024 14:53:07 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::b29; envelope-from=lichengtai@gmail.com; helo=mail-yb1-xb29.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19637 Archived-At: Hi, a question on access to C pointer in scheme: if a C function returning a pointer is wrapped and accessed from scheme code, int64_t * func() { int64_t *p = make_new_pointer(); *p = // something return p; } in scheme (GNU guile) (set! p (func)) it is possible to see that p is now a pointer. How to dereference the pointer to get the value it points to, in guile, on the scheme side? Thanks