comp.lang.ada
 help / color / mirror / Atom feed
From: fmanning@netmedia.com
Subject: For loop step size
Date: 1998/08/07
Date: 1998-08-07T00:00:00+00:00	[thread overview]
Message-ID: <6qfvjl$v2e$1@nnrp1.dejanews.com> (raw)

Concerning the restriction on step sizes in for-loops -- I'm writing a
Basic compiler for a small 8-bit microcontroller. The language is a
subset of Visual Basic. Since the processor is small, time is short and
VB is big, we can only implement a small subset of the language.

Being an Ada-phile, I naturally tend to pick a subset that is as
Ada-like as possible.

For example, strong typing is used, for-next loops are restricted to
discrete types, and the step size is restricted to +/-1. The step size
restriction in particular has caused some consternation.

I read through the Jan 97 thread in cla when this subject came up, and
I think I understand the basic rationale for the Ada restriction --
that is, programmers are prone to making mistakes in getting loops
to terminate correctly if step sizes are arbitrary.

I guess my question is whether this same rationale makes sense for
a language as different as VB. Looking for ammunition...

-- Frank Manning

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




                 reply	other threads:[~1998-08-07  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox