New Features/Code in Subversion

2 views
Skip to first unread message

andrew cooke

unread,
Jan 29, 2011, 7:40:22 AM1/29/11
to Lepl

I've committed changes I made on the flight. These are:

- The matcher that was called "Float" is now called "Real" (this
matches integer and floating point values)
- The matcher that was called "Rational" is now called "Float" (this
does not match integers)
NOTE THAT THE ABOVE MAY BREAK EXISTING CODE

- There is a new matcher called Difference, as discussed (so now Float
= Difference(Real, Integer))
- There is a new matcher called Limit, as discussed (with an optional
argument "count" that is the number of matches returned; by default
count=1)
- The array slice syntax has been changed so that the third index
(stride) is implies a Limit with that count. So foo[1:1:n] is the same
as Limit(foo, count=n). You can still use 'd','b' etc for algorithms,
and also mix the two, so foo[1:1:'b2'] gives a maximum of two results
from a breadth-first search.

- I've updated the docs, changing all the examples that used Float to
use Real instead.
- I've added a new section in "advanced" explaining Difference and
Limit

This is only in subversion. The site docs and released source are
still at 4.3.5. Any feedback before I release (later this weekend)
appreciated.

In particular, is renaming Float() to Real() and then adding something
similar but different as Float() going to cause too much pain? My
impression is that Lepl has very few users, and that they don't often
update, but I may be underestimating the harm this will cause. I'm open
to alternative suggestions, but I think in the long term the naming
above makes more sense.

Cheers,
Andrew

Florian Leitner

unread,
Jan 29, 2011, 10:02:34 AM1/29/11
to le...@googlegroups.com
Well, I'd be perfectly fine with that name change - after all, it would only take changing every occurrence of "Float" to "Real", and anybody (such as me) using the new 4.3.5 "Rational" could change it to the more precise "Float". Not a big deal, I'd say, versus the long-term impact of the far more intuitive naming convention. But then I was the reason all this broke off - so maybe I'm not exactly impartial on this issue and the grammar I'm working on isn't exactly huge, so its maintenance isn't a big issue...

But if you perceive it as a "dangerous" change, maybe you could do two releases, one, 4.3.6, now, with the old Float and no new matchers, but raising a deprecation warning on the Float, and as soon as you are ready a 4.4.0 release with the real name change, the new matchers, and whatever else your might have planned as 4.4 milestones? This way you could observe if anybody suddenly posts here about that warning, and a minor release number upgrade should warrant the effort to check the difference between 4.4 and 4.3.

Also, looking forward to trying out the difference and limit matchers, I think that is a really useful shortcut for some languages - thanks for adding that so fast, too!

--Florian

> --
> You received this message because you are subscribed to the Google Groups "lepl" group.
> To post to this group, send email to le...@googlegroups.com.
> To unsubscribe from this group, send email to lepl+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/lepl?hl=en.
>

andrew cooke

unread,
Jan 30, 2011, 7:14:49 AM1/30/11
to le...@googlegroups.com

I'm not so keen on adding an artificial delay to deprecate something.
Instead I've added a simple warning system. If you use Float() (and
similar) with the latest subversion code then a message is printed to
stdout:

WARNING: The definition of the Float matchers changed in Lepl 4.4.0
(you may want to use Real instead).
To disable this message call
lepl.support.warn.silence('SignedEFloat')

so, as described, you would need to add

lepl.support.warn.silence('SignedEFloat')

to your code.

At some later point I will remove that warning.

Andrew

Reply all
Reply to author
Forward
0 new messages