Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Experiment - List of strings

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 729

PostPosted: Mar 3rd, 2012, 6:48pm    Post subject: Experiment - List of strings Reply with quote

This is another thought experiment.
Code:
require stdStreams, stdContainers

list(string) #cities, "New York", "Chicago", "Los Angeles"
#cities add("London", "Paris", "Rome")
#cities: add("Tokyo"): add("Beijing"): add("Moscow")
for each city$ in #cities
   #out line(city$)
end for
end

Code:
Module StdContainers
class list(T) is container(T)
   '...
   constructor arr() as T
      '...
   end constructor
   method add x() as T
      '...
   end method
end class

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Mar 4th, 2012, 2:29pm    Post subject: Re: Experiment - List of strings Reply with quote

Yes, linked lists would be very handy.

To be able to create lists of types would enable using lists of custom structures, which makes some things really easy for a user of that language.

_________________
Stefan

Any code I post can be freely used, just give credit.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group