in reply to Thoughts on Exegesis 7

While form() makes sense if its used without print, I can't help thinking print using "..." reads better than print form "..."

(though I haven't programmed basic in almost 20 years)

Replies are listed 'Best First'.
Re: Re: Thoughts on Exegesis 7
by theorbtwo (Prior) on Feb 29, 2004 at 09:23 UTC

    Eeep! print using is an operator with a space in it in BASIC. That's the sort of thing that makes a syntax ugly, ugly, ugly. Alternatively, you make using a synonym of format, in which case you're using up the rather nice name "using" for something very specific, which you can already write another way.

    (Using would make a rather nice statement-modfier form of given, but I can't help thinking that there's something larger it could be used for.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      Would it be something similar to with in VB or Javascript? While we have that idea in for-aliasing, it certainly would be nice to have that concept a little more elaborated. I could see the benefit as such:
      # $object1 has the interface foo # $object2 has the interface bar and baz with ($object1) { with ($object2) { bar; foo(baz); } }
      and have it be interpreted as:
      $object2->bar; $object1->foo($object2->baz);

      Obviously, this is a contrived example, but it could be kinda neat ...

      ------
      We are the carpenters and bricklayers of the Information Age.

      Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

        I think given does this.


        Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Re^2: Thoughts on Exegesis 7
by Aristotle (Chancellor) on Mar 01, 2004 at 08:26 UTC
    I'm sure it'll be easy to retool things so you can say
    print $foo, $bar, :using("|{>>>>}|{<<<<<<<}|\n|------+---------|"), $baz :using("|{||||||||||||||}|")
    or some such and have it magically transform into what you wanted behind the scenes.

    Makeshifts last the longest.