Recent

Author Topic: Why "at" is not a reserved word?  (Read 2506 times)

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Why "at" is not a reserved word?
« on: August 13, 2017, 05:55:26 pm »
This example is given here: https://www.freepascal.org/docs-html/ref/refse112.html

Quote
raise Exception.Create(msg) at
        get_caller_addr(get_frame),
        get_caller_frame(get_frame);

I was wondering why the "at" is not a reserved word. If not, what it is?
Be mindful and excellent with each other.
https://github.com/cpicanco/

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11445
  • FPC developer.
Re: Why "at" is not a reserved word?
« Reply #1 on: August 13, 2017, 06:05:43 pm »
Usually only words that start  a block (like in this case "raise") are reserved.

Words further down the line are not likely to raise conflicts (because you can't call e.g. an identifier there) and thus there is no reason to exclude them from the list of possible identifiers.

Thaddy

  • Hero Member
  • *****
  • Posts: 14359
  • Sensorship about opinions does not belong here.
Re: Why "at" is not a reserved word?
« Reply #2 on: August 13, 2017, 06:06:43 pm »
A.K.A. a compiler intrinsic. These do not always represent a reserved word.
Compiler intrinsics are basically operators. functions and procedures which have a greater range of syntactic freedom from which the complexity is nicely hidden from us.
« Last Edit: August 13, 2017, 06:11:37 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11445
  • FPC developer.
Re: Why "at" is not a reserved word?
« Reply #3 on: August 13, 2017, 07:01:49 pm »
No, not like intrinsics. Intrinsics are like predefined procedures, but with internal implementation (and usually relaxation of typing0 and thus appear in places where identifiers also would appear.

AT is at a place where a normal identifier should appear. It is part of a block construct, but not a FIRST token.

Thaddy

  • Hero Member
  • *****
  • Posts: 14359
  • Sensorship about opinions does not belong here.
Re: Why "at" is not a reserved word?
« Reply #4 on: August 13, 2017, 08:51:19 pm »
AT is at a place where a normal identifier should appear. It is part of a block construct, but not a FIRST token.
Operators are not a first token... I merely explained how and why in simple terms.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11445
  • FPC developer.
Re: Why "at" is not a reserved word?
« Reply #5 on: August 13, 2017, 09:15:14 pm »
I don't see intrinsics as operators, as said they use pseudo function call syntax, rather than infix expression operators.

Things like the ROR intrinsic doesn't really need special treatment in the parser (except to pass through), all the magic happens in the backend.

 

TinyPortal © 2005-2018