Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Discussion of interval literal syntax



John et al,

Ah, yes. We have clashes in a couple of languages with the ever-popular "[" and "]". Such things are ubiquitous; It is similar to what I found when using ".IS." in Fortran for the intersection operator, even though ".IS." is not intrinsic. I even found it
when trying to use my last name as a login ID to a popular e-newspaper
site. Unfortunately, I don't have a good answer to deal with such clashes, but I think,
as Bill says, we should be aware of them in the most popular languages for
scientific (perhaps limited to floating point??) computing, to craft the document
in an informed way.

Best regards,

Ralph Baker Kearfott

On 07/20/2013 03:28 PM, John Pryce wrote:
Michel

On 2013 Jul 20, at 19:03, Michel Hack wrote:

Yes, particularly for a function that reads objects from a file or standard input, and determines on the fly what kind of object it is.

It just strikes me that an important language of that kind is Matlab (and its clones). Unfortunately there is an unavoidable clash: Matlab uses brackets to construct arrays so they are unavailable for intervals. Here is the "input" function being used with in effect dynamic-typing (is that the same as implicit-typing?):

while true, x=input('Give x: '), end
Give x: 1.23                %scalar
x =  1.2300
Give x: [1.2,3.4;5.6,7.8]   %2 by 2 array
x =

    1.2000   3.4000
    5.6000   7.8000

Give x: {1,2,3,4}           %cell vector
x =

{
   [1,1] =  1
   [1,2] =  2
   [1,3] =  3
   [1,4] =  4
}
etc.

When a 1788 implementation is built in Matlab, it would be nice to overload "input" so that it can read intervals using text2interval(), but that would need a syntax change! Any ideas?

John Pryce



--

---------------------------------------------------------------
R. Baker Kearfott,    rbk@xxxxxxxxxxxxx   (337) 482-5346 (fax)
(337) 482-5270 (work)                     (337) 993-1827 (home)
URL: http://interval.louisiana.edu/kearfott.html
Department of Mathematics, University of Louisiana at Lafayette
(Room 217 Maxim D. Doucet Hall, 1403 Johnston Street)
Box 4-1010, Lafayette, LA 70504-1010, USA
---------------------------------------------------------------