Re: What's holding Euphoria back?
- Posted by Daniel Berstein <daber at PAIR.COM> Jan 31, 1999
- 402 views
At 12:33 p.m. 31-01-99 -0800, you wrote: >That I understand...But what type checking is done on a sequence except >when it is read from? The way i understood the setup of a sequence was >all in the way it was read...That should do all the type checking that >is needed... Sorry but I don't understand you. Are you saying that it ain't important how you store the data, but the way you read it?! I don't want to be rude, but you're mistaken. The way you storage information and how you retrive it are BOTH important. I'm an excellent spanish reader, but give me a german book and I won't understand a word! >The section that reads the sequence should know if its a >text or numbers...I also under stat that writing to a sequence you need >to know the kind og data that is there..again the program should know >what kind of data it is...I guess I just dont get it...Just write the >program in a way that you dont have a tex funtion reading a number data >block and things should work(at least in my mind it does...but then >again there is no gravity in my mind so its a judgment call..)... You're right here. It works... that's the way we do it now. That doesn't mean it's the best way to do it. Sequences by definition are anarchist data strcutures, they let you do the most inimaginable construct. That is GOOD, and makes Euphoria unique. The problem is that real life problems need real life solutions. Look at languages like Lisp, Scheme or Haskell, they are great for investigation (AI, speech recognition, etc.), and rarely go beyond academic walls. Euphoria has a clear orientation to a practical solution tool. To survive (and prospere) the real world Euphoria must adecuate. >I do like the idea of formated sequences... Me too ;) >sequence aaaa{ > number of people in the room > each persons name > { > number of people in the room > each persons name > there age > } > } > >the sequence is set up {XXX,{YYY,"name",ZZ) I was thinking some kind of template: template roommate {sequence name, integer age} end template template room {integer room_number, sequence roommates of roommate} end template sequence bedrooms of room Now I can do: sequence me of roommate sequence myroom of room me[name] = "Daniel Berstein" me[age] = 25 myroom[room_number] = 101 myroom[roommates] = append(myroom[roommates], me) bedrooms = append(bedrooms, myroom) Can you see how this code is much more readable than the way we have to do it now? BTW A SizeOf() function would be helpful for I/O routines too. >"john Q. plublic" has numbers for a name? there can be numbers in the >name...just remember every thing is ascii.... I rember that all the time ;) Regards, Daniel Berstein daber at pair.com