[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Dr. Geo] how to use a input parameter in DrGeo SmalltalkSketch
From: |
address@hidden |
Subject: |
Re: [Dr. Geo] how to use a input parameter in DrGeo SmalltalkSketch |
Date: |
Thu, 18 Apr 2024 21:54:05 +0200 (CEST) |
I tried to run the example:
| f ruler a |
f _ DrGeoSketch new axesOn.
ruler _ f float: 1.5 at:0@0 from: 1 to:4.
(f value:ruler parents: {} at: -2@4) name: 'Value from a ruler'.
a _ f value: [ ruler value / 3].
f circleCenter: 0@0 radius: a.
The code with value: taking a Block as argument (the Block [ ruler value / 3])
seems to work in the latest DrGeo.
Regards,
David Stes
----- Op 13 apr 2024 om 11:36 schreef Hilaire Fernandes hfern@free.fr:
> Hi David,
>
> You can fetch the latest commit of DrGeo. I have implemented the issue
> #31 value defined by block. It results in much simpler Smalltalk sketch
> to write. See this example:
>
>|f ruler a |
> f := DrGeoFigure new axesOn.
> ruler := f float: 1.5 at: 0@0 from: 0 to: 10.
> (f value: ruler parents: {}at: -2@4)name: 'value from a ruler'.
> a := f value: [ruler value / 3].
> f circleCenter: 0@0 radius: a
>
> In the class DrGeoSketch you can browse the "value" method category to
> see the existing method.
>
> Testing is more than welcome, I have not entirely tested it; for example
> when a value by block also receive parent parameters..
>
> Hilaire
>
> --
> GNU Dr. Geo
> http://gnu.org/s/dr-geo/
> http://gnu-drgeo.blogspot.com/