Re: Data validation (was Re: Stupid Newbie-sounding question.)

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 01 Jun 2004 18:26:26 -0700, Derek Parnell
<guest at RapidEuphoria.com> wrote:

>BTW, how would the user defined type routine get to know which parts of 
>the variable have been modified? Currently, the entire object is passed
>to the routine, but there is no indication which parts were changed.

Good question. My first reaction was that if you have
type thing(sequence of whatever)
then only pass the modified slice.

However we need to do something about eg:

type ordered_list(sequence l)
object item
	if length(l)=0 then return 1 end if
	item=l[1]
	for i=2 to length(l) do
		if compare(item,l[i])=1 then return 0 end if
		item=l[i]
	end for
	return 1
end type

Maybe if we allow:

type thing(sequence of whatever, integer from, integer to)

the interpreter could throw different bits at a 3-parameter type
definition, as opposed to throwing the entire object at a 1-parameter
type definition?

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu