[q-lang-users] Symbol type
Brought to you by:
agraef
From: Burton S. <kr...@gm...> - 2006-08-22 23:38:14
|
Hi Again, So, after getting over my little problem with the prelude option, I managed to expand my cat routine in the following way, to handle multiple arguments: cat F:String = cat_file (fopen F "r"); cat F:File = cat_file F; cat F = cat_file (fopen (str F) "r") if issym F; = prints "cat: unsupported type"; cat_file F:File = () if feof F; = putc (fgetc F) || cat F otherwise; Since I'm just learning the language, I figured I'd make a cat function that handled multiple types, like actual File handles, string/quoted names and symbol names (so it looked more like the Unix shell). The only problem that I found with that was that there was no Symbol type (that I could find), so my code for handling that case had to differ from the String and File handlers by using an 'if issym' call, which works fine, but breaks consistency with the other options. Not that that is a big problem, but one of the reasons I like higher level languages is their ability to work with actual language symbols as a type (something about the idea of symbols works very well with how my brain is wired). Is the Symbol type left out for a reason, or is it under a different name that I haven't found yet? Would there be any objection to adding it? -- burton samograd kr...@gm... kruhft.boldlygoingnowhere.org www.myspace.com/kruhft |