User talk:Wherrera: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
(added some clarification concerning program statement columns.)
Line 24: Line 24:
Found the problem: I had a floating point precision error. Thanks for checking.
Found the problem: I had a floating point precision error. Thanks for checking.
-- [[User:Wherrera|Wherrera]] 23:54, 15 November 2019 (UTC)
-- [[User:Wherrera|Wherrera]] 23:54, 15 November 2019 (UTC)


== comments about source statements that can start in column one ==
Concerning the Rosetta Code task   (''Long literals, with continuations'')   regarding (source) statements that can start in column other then one was meant for those computer programming languages that have column dependencies, some of which are (or used to be) such languages like:

:*   BASIC   (various flavors)   some columns were meant for statement numbers
:*   COBOL
:*   older versions/flavors of FORTRAN (note the uppercase spelling) when columns 1 --> 5 were meant for statement numbers, and column 6 was for continuation), nowadays, it seems that most Fortrans are free-form
:*   PL/I   (used to)   optionally reserve column one for carriage control, and statements started in column two
:*   some assembler languages, where tokens starting in column one were reserved for statement labels
:*   other computer languages that used a non-blank character in column seventy-two for continuation
:*   other computer languages that used columns 73 --> 80 for sequencing numbers
:*   ... and I'm sure many other   (possibly older if not ancient)   languages had column specifications for (statement) start and/or continuation


It would be interesting to learn (and know of) these old restrictions/specifications for non-free form computer programming languages.     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 05:28, 24 March 2020 (UTC)

Revision as of 05:28, 24 March 2020

Hi, is there really a high chance that Julia users will see the word range on a site catering to multiple languages, and think the task ight be about Julia's range type? Python, Perl, and probably many more have something with that name, you pointing that out for Julia makes it seem as if you think Julia users might not otherwise be able to understand the difference. Odd? --Paddy3118 (talk) 21:15, 15 February 2019 (UTC)

reply to above

As mentioned in the discussion of the Ranges task, there is an ambiguity in the meaning of range since in computer languages it may mean either the bounds of some type of value or an iterator type. See for example the entry in Wikipedia: https://en.wikipedia.org/wiki/Range_(computer_programming). So the comment is reflecting on that ambiguity, though I doubt anyone would be misled once they read the task description. Someone landing on the page from a Google search, without the comment I put in, might have cause for brief confusion.

Thanks for the reply Wherrera, to me, it seems that every language examples to be examined in the context of the task being solved, which in these cases removes the ambiguity. But no harm is done 😉--Paddy3118 (talk) 01:03, 16 February 2019 (UTC)

Your Julia solution for the Chemical Calculator really blows my mind. Exactly what I was hoping for, when publishing the problem here at RC. Are there other languages that gives the same RegEx feeling? --ChristerNilsson (talk) 04:01, 19 March 2019 (UTC)

You may be able to implement the method in any language that has regexes and a way to evaluate a string as a program in the context of the running program. --Wherrera 07:00, 19 March 2019 (UTC)

Yes, I found out how to do it in CoffeeScript. But Nim will be harder as it lacks run time eval. eval is available only for compile time. I think it should be possible to enter new molecules without having to recompile. So, I guess, an interpreted language is needed.

Also, regexes seem to have very different apis between languages. They seem to be as quick as handwritten parsing, though. --ChristerNilsson (talk) 01:24, 20 March 2019 (UTC)

Your example for Palindromic gapful numbers

has wrong output for 1,000,000 for digit 9.Maybe there is an Int64 overflow 91,189,796,469,798,119 = 9.1E16 Horst.h (talk) 10:39, 15 November 2019 (UTC)

There should not be an overflow with 64 bit integers and those numbers. It may be a variation in generation order between implementations. -- Wherrera 19:02, 15 November 2019 (UTC)

Found the problem: I had a floating point precision error. Thanks for checking. -- Wherrera 23:54, 15 November 2019 (UTC)


comments about source statements that can start in column one

Concerning the Rosetta Code task   (Long literals, with continuations)   regarding (source) statements that can start in column other then one was meant for those computer programming languages that have column dependencies, some of which are (or used to be) such languages like:

  •   BASIC   (various flavors)   some columns were meant for statement numbers
  •   COBOL
  •   older versions/flavors of FORTRAN (note the uppercase spelling) when columns 1 --> 5 were meant for statement numbers, and column 6 was for continuation), nowadays, it seems that most Fortrans are free-form
  •   PL/I   (used to)   optionally reserve column one for carriage control, and statements started in column two
  •   some assembler languages, where tokens starting in column one were reserved for statement labels
  •   other computer languages that used a non-blank character in column seventy-two for continuation
  •   other computer languages that used columns 73 --> 80 for sequencing numbers
  •   ... and I'm sure many other   (possibly older if not ancient)   languages had column specifications for (statement) start and/or continuation


It would be interesting to learn (and know of) these old restrictions/specifications for non-free form computer programming languages.     -- Gerard Schildberger (talk) 05:28, 24 March 2020 (UTC)