Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #37372
| From | "WJ" <w_a_x_man@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: local variable |
| Date | 2015-03-18 05:04 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <meb11d$jve$1@dont-email.me> (permalink) |
| References | <5504c7af$0$2974$426a74cc@news.free.fr> |
grobibi wrote:
> Hello,
> There is something I don't understand with local variable with gforth.
> A variable defined like this :
>
> variable x 10
>
> will have a general scope. How can I get a
> local scope for a variable inside a word definition ? Is it possible ?
>
Oforth:
x is the local variable.
func: pair-with-squares(list)
{|x| list map( #[ -> x [x, x x *]])}
> [2,3,4] pair-with-squares println
[[2, 4], [3, 9], [4, 16]]
ok
> pair-with-squares([5,6,7,8]) println
[[5, 25], [6, 36], [7, 49], [8, 64]]
ok
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
local variable grobibi <tristanhennequin@free.fr> - 2015-03-15 00:43 +0100
Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-03-14 15:01 -1000
Re: local variable grobibi <tristanhennequin@free.fr> - 2015-03-15 02:50 +0100
Re: local variable albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-15 03:02 +0000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-15 02:53 +0100
Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-17 22:29 +0000
Re: local variable hughaguilar96@gmail.com - 2015-03-14 20:45 -0700
Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-15 10:53 +0000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-15 22:54 +0100
Re: local variable hughaguilar96@gmail.com - 2015-03-15 19:45 -0700
Re: local variable hughaguilar96@gmail.com - 2015-03-15 20:15 -0700
Re: local variable grobibi <tristanhennequin@free.fr> - 2015-03-16 08:42 +0100
Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-16 07:51 +0000
Re: local variable hughaguilar96@gmail.com - 2015-03-16 09:59 -0700
Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-16 20:31 +0000
Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-18 08:59 +0000
Re: local variable "HAA" <someone@microsoft.com> - 2015-03-17 13:47 +1100
Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-17 10:59 +0000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 18:55 +0100
Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-17 18:43 +0000
Re: local variable "HAA" <someone@microsoft.com> - 2015-03-18 13:25 +1100
Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-03-17 16:43 -1000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-18 04:09 +0100
Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-03-17 17:55 -1000
Re: local variable "HAA" <someone@microsoft.com> - 2015-03-20 22:28 +1100
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-20 15:43 +0100
Identifying self interest (was Re: local variable) "Alex McDonald" <blog@rivadpm.com> - 2015-03-20 15:20 +0000
Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-18 08:48 +0000
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 14:18 +0000
Re: local variable albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-17 16:24 +0000
Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-17 16:34 +0000
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-18 14:32 +0000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 20:08 +0100
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-18 15:21 +0000
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-16 15:36 +0000
Re: local variable hughaguilar96@gmail.com - 2015-03-16 10:09 -0700
Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-16 20:24 +0000
Re: local variable "Rod Pemberton" <buzz@notnotnontnooatno.cmm> - 2015-03-16 19:00 -0400
Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-17 12:06 +0000
Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-17 14:37 +0000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 18:58 +0100
Re: local variable Doug Hoffman <glidedog@gmail.com> - 2015-03-17 08:55 -0400
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 14:15 +0000
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 16:54 +0000
Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-17 17:45 +0000
Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 20:14 +0100
Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-20 15:06 +0000
Re: local variable hughaguilar96@gmail.com - 2015-03-20 16:14 -0700
Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-21 09:47 +0000
Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-18 05:04 +0000
Ignore the standard Stefan Mauerhofer <smauerhofer@androsoft.ch> - 2015-03-18 04:09 -0700
Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-18 07:26 -0400
Re: Ignore the standard "WJ" <w_a_x_man@yahoo.com> - 2015-03-20 17:31 +0000
Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-20 17:41 -0400
Re: Ignore the standard "Elizabeth D. Rather" <erather@forth.com> - 2015-03-20 14:26 -1000
Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-21 06:00 -0400
Re: Ignore the standard hughaguilar96@gmail.com - 2015-03-21 15:11 -0700
Re: Ignore the standard Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-21 02:49 +0100
Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-21 06:04 -0400
Re: Ignore the standard "Alex McDonald" <blog@rivadpm.com> - 2015-03-18 16:05 +0000
Re: Ignore the standard "WJ" <w_a_x_man@yahoo.com> - 2015-03-20 17:13 +0000
csiph-web