bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #13865] Symbols don't evaluate to themselves when they l


From: Per Bothner
Subject: [Bug-kawa] [bug #13865] Symbols don't evaluate to themselves when they look like units
Date: Wed, 20 Jul 2005 18:42:00 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+

Update of bug #13865 (project kawa):

             Assigned to:                    None => bothner                

    _______________________________________________________

Follow-up Comment #2:

"The bug is when you use a symbol that looks like a unit number but for a unit
that doesn't exist."

7min is not a symbol; it's a quantity literal - i.e. a number.
Note that '07min => 7min
If you want a symbol, you meed to escape it:
'|10volts| => 10volts
This just like quoting integers: '|010| => 010

What's happening 7min is resolved at read-time, so it resolves to a
self-evaluating quantity. Quoting a self-evaluating quantity has no effect.
However, 10volts cannot be resolved at read-time so it reads as an expression
that evaluate to the right thing.  Quoting that expression will change its
meaning.

The inconsistency is arguably a bug: We should probably resolve all quantities
at either read-time or at expansion-time.  Perhaps the right solution is to
allow quantities with unresolved units.  The reader returns such a quantity;
then the quantity is resolved  later, using lexical or dynamic scope to look
up units.  However, there are problems with this approach.

The "correct" solution may be to change 7min so it behaves like 10volts, in
that the unit-resolution is done *after* read-time.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13865>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]