Re: Swimming against the tide, again (this time with numbers)

2014-09-02 Thread Tomas Hlavaty
Hi Christophe,

> Christophe Gragnic  writes:
> is my suggestion:
> «…by multiplying with (or dividing by) the scale factor.»
> could become
> «…by multiplying with (or dividing by) the scale factor, which is always 
> `1.0`.»

it doesn't have to be always 1.0.  If it was, it would not need to be
there at all.

Cheers,

Tomas
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Swimming against the tide, again (this time with numbers)

2014-09-02 Thread Christophe Gragnic
Hi all,

On Mon, Sep 1, 2014 at 6:05 AM, Tomas Hlavaty  wrote:
>> : (* 1.0 1.0)
>> -> 100
>
> You want: (*/ 1.0 1.0 1.0), see http://software-lab.de/doc/ref_.html#*/

That's funny because I read about */ right before posting my email but
couldn't connect with my problem. If there is room for clarification, here
is my suggestion:
«…by multiplying with (or dividing by) the scale factor.»
could become
«…by multiplying with (or dividing by) the scale factor, which is always `1.0`.»
Suggested examples:
: (scl 1)
-> 1
: 1.0
-> 10
: (* 1.0 1.0)
-> 100
: (*/ 1.0 1.0 1.0)
-> 10

On Mon, Sep 1, 2014 at 6:23 AM, Alexander Burger  wrote:
>
> The solution would be to extend the internal representation of numbers,
> e.g. with an additional bit to distinguish between non-scaled and scaled
> integers.

I guess that you don't plan to alter PicoLisp this way.
And there is no magic way to alter the reader, or from Lisp?

> In fact, I would not try to explain it with these examples, but
> work _only_ with scaled integers first. Should be no problem for
> you as a math teacher.
> And then explain that the dot is just a read macro, not part of
> the language machinery per se.

My strategy for now is to only work with integers first, even with /.
Then explain that if decimals are needed, a scale must be choosen,
and numbers must be entered with a dot, or they will be read as
tenths for a scale of 1, millionths for a scale of 6…

I'll try to show, for a scale of 1, «1» instead of «10» using 'format cleverly.


chri

-- 

http://profgra.org/lycee/ (site pro)
http://delicious.com/profgraorg (liens, favoris)
https://twitter.com/profgraorg
http://microalg.info
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: try picolisp

2014-09-02 Thread Thorsten Jolitz
Christophe Gragnic
 writes:

> On Mon, Sep 1, 2014 at 10:02 PM, Thorsten Jolitz
>  wrote:
>>
>> could you elaborate on this a bit?
>
> Sorry, I cannot give you better info that what is in the ref:
> http://www.tcl.tk/man/tcl8.6/TclCmd/interp.htm#M4

thx for the link!

-- 
cheers,
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe