From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6PaYFHk3VmP+SAEAbAwnHQ (envelope-from ) for ; Mon, 24 Oct 2022 08:58:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wMavFHk3VmOAnwAAauVa8A (envelope-from ) for ; Mon, 24 Oct 2022 08:58:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 02924397B5 for ; Mon, 24 Oct 2022 08:58:01 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ommPy-0001xx-C5 for larch@yhetil.org; Sun, 23 Oct 2022 21:38:18 -0400 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 1omZwW-0007CH-Qe for emacs-orgmode@gnu.org; Sun, 23 Oct 2022 08:19:04 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omZwV-0000KZ-2p for emacs-orgmode@gnu.org; Sun, 23 Oct 2022 08:19:04 -0400 Received: by mail-wr1-x42b.google.com with SMTP id bv10so11579663wrb.4 for ; Sun, 23 Oct 2022 05:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=w51OYUg7d5eDhwfkJrSAcgO5Ou8tTFG2e8vT5psmEe8=; b=W2j47CXZeSr4FNqYPaK0JOobLb6zdQgftC4sVYsBhxvnJGlPqKxfx3a9G1fuI5Yj72 aDDZZ9yBI2b24aifEsUbxX751567TELCXHJP5sA5EdGQmRS9CBCmgX9Dqlt9ktkIsiI/ 2k+lk34OqwPkfHzKPTO9xroIkoD+2nLgExXfA7jmYO0iBjT0Z3Vv57+Bsc0/WV0l15IK qixuuRON/MENaj1/DQfpu36ghcEyUpgPP5BwK/O4l+TxGFFCaxbccOLKEXPZkpo3FCgy dVjn/dkJNjobX//VjHUd6e33W1AUXrEUargiQDAuli21+lOCEEktHmuNLTDaIlDkEE3k nhaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:to:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w51OYUg7d5eDhwfkJrSAcgO5Ou8tTFG2e8vT5psmEe8=; b=o08DkvRN+/GMC9c4S8qnUJoWbAArnBbMcHVomgLN8AJVbH625lptIeJQaL79a2HvNe R+1cj7AsNiFda95zGQ0N4E9Z9G1N5KlI4b9A4bsZZDkzaRR5N5r24BmexKrEZr3n6hsz nq6fixUIJ7hoi+AUhzCs69viM5j20nw0bs5a9rISxBsp4XbrIKzwcjPeYjicYlTe5r+o RlFj/9Xzd568cs9+t++Ps9P3RppwoibQC213hmjYr1RM5qdt8RvIzfWPughnBgMo6fsl NtYsySj3rtndp9PC7qYdOZ9EUi9xMG7An6tSU/r3/6D4mF+fVtZYdy4VRn5oTOyhF6kV b/rQ== X-Gm-Message-State: ACrzQf3ZrWG9gEuoNQ7rIieyGLW3uEKERQas80DilCKwat5BNZASdcjf GzFXfUrFbbARRdLYAp2OkbSLZmlpjpybbA== X-Google-Smtp-Source: AMsMyM7OR3JquZOvIWZtWHVVIbXgvSr2MFWo5ZEEGcRF+a8WryldqYiwB7QD4FWGJG5vRTg9rR0koA== X-Received: by 2002:a5d:522f:0:b0:235:c877:5cdc with SMTP id i15-20020a5d522f000000b00235c8775cdcmr11789372wra.352.1666527540912; Sun, 23 Oct 2022 05:19:00 -0700 (PDT) Received: from [192.168.0.97] (static-208-192-229-77.ipcom.comunitel.net. [77.229.192.208]) by smtp.gmail.com with ESMTPSA id ay19-20020a05600c1e1300b003a1980d55c4sm5331998wmb.47.2022.10.23.05.18.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Oct 2022 05:19:00 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------dX6Og77xWZkSsjViZvgiFy05" Message-ID: Date: Sun, 23 Oct 2022 14:15:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-GB From: Ypo To: Org-mode Subject: LIterate programming with calc (help) Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=ypuntot@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=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: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666594681; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=w51OYUg7d5eDhwfkJrSAcgO5Ou8tTFG2e8vT5psmEe8=; b=sTbqKAF28NIYLiLHtTjKAK4iG0wmIeA4EhuPRk+LgAMnu5+6V+2PocVs1xc+EFRQ+fifR8 CiRGxSnaenw0QaM0rEJFNRy6skCINtGpQnXWcbUAIbgrKQXqA8jDt7DD25NxjffDLJlpGd dhZDT9CU7OW6bcrDXDdVXQD3mA1SzCjHGmVqZRivQjG1/zWBEPm6ZuRhKg23aowe0hc5MK eksYJf9pn9yxK/ha2koCLXxIpJTP0kGP8cDqvyeZ/IsUkPNcWmeKKLqknYeEUWhsBHo0zZ DiBu5w7qhDXHJhaooc4+BMXVK6N9x5/UjkHZ7afckhX/flGw4k+Zit3O5nc0Dg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666594681; a=rsa-sha256; cv=none; b=gqHYyjlEfbq6JbuEzPztqUM06X4famqyuD11UY8lU421Njaj/03p0TW9GgoGFcQos1MU3H wobDFBAJAhmhyGJufucNRt+Eur91XhhAv0SSyMl7Uo5+DP5JVSGexZCrmWLJ2ZUqjRyTsT UTCAZxK7yg6BRzHCbGpnMIC307IhIo849MHQlnckCawwdJEcQ97TxaKl12UG+y48LLOMOQ zKzxLNUTznuGi7E97TrniuEQ0QtyNEl1UrEOr2D71fYUsIvfa6Fq4cRjndcJkr8s/s/802 Tx3vfxtoATeCAkZLar7td01mHOaHGsOA+6M0Uu/m2ctA7VSXTHCkXHKovthXKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=W2j47CXZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.40 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=W2j47CXZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 02924397B5 X-Spam-Score: -2.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: uepwzYqEWfwG This is a multi-part message in MIME format. --------------dX6Og77xWZkSsjViZvgiFy05 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Is it possible to express in a calc block some basic operations with variables and non-predefined units? For example, if you wanted to build a code block that calculates how much money costs: a land with an Area of 300x300 m^2 at a price of 1 $/m^2. Would it be something like this? #+begin_src calc   a = 300 m   b = 300 m   Area = a*b   cost = 1 ($/m^2)   A*c #+end_src Is it possible to work with the "$" unit? Why A*c won't show an arithmetic result, but ~: A c ~? Wanted result is: #+RESULTS: : 90 000 $ Best regards --------------dX6Og77xWZkSsjViZvgiFy05 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Is it possible to express in a calc block some basic operations with variables and non-predefined units?


For example, if you wanted to build a code block that calculates how much money costs:

a land with an Area of 300x300 m^2 at a price of 1 $/m^2.


Would it be something like this?

#+begin_src calc
  a = 300 m
  b = 300 m
  Area = a*b
  cost = 1 ($/m^2)
  A*c

#+end_src


Is it possible to work with the "$" unit?

Why A*c won't show an arithmetic result, but ~: A c ~?

Wanted result is:


#+RESULTS:
: 90 000 $


Best regards

--------------dX6Og77xWZkSsjViZvgiFy05--