Author Topic: Haskell (formerly: Languages, got to learn another one)  (Read 8961 times)

0 Members and 1 Guest are viewing this topic.

Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #35 on: October 30, 2016, 12:11:26 PM »
Numerical simulation, physics modelling.

I'm very happy with Fortran, regardless of its bad reputation it is a decent language (past 95). My only gripe with it is how awkward it is to write and call functions. My only gripe with it is that they went OOP instead of functional when they extended from a purely imperative paradigm.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4502
  • Total likes: 151
  • Helpful: 105
  • Languages: EN, NO
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #36 on: October 30, 2016, 12:35:48 PM »
Numerical simulation, physics modelling.

And someone is doing that in Java? Lunatics. C# might be somewhat better, but I have no serious experience with that. C++ strength in that field is perhaps that it both lets you create and work with some higher level abstraction, but also get down to the bare metal if needed (C doesn't do the abstractions as well). My only brush with number crunching was with C/C++ and OpenMP, but I'm sure there are other languages. However, with programming, it is not as important what languages you do know, as which languages you can know. The underlying principles are generally the same. There might be more differences in how to program effectively on different architectures, than how to program in different languages.

Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #37 on: October 30, 2016, 12:51:26 PM »
There were indeed done job adds that mentioned Java. These are not necessarily full time developers but more general engineering. A lot is also not that computational intensive.

Often job adds did not seem entirely consistent. I wonder if they can get anyone on earth that fulfils all necessary requirements.

I am confident that I wouldn't have much difficulties to learn C/C++. It's not unfamiliar to me. But I do not have experience worth to mention with it. What is more friends who do such jobs teacher care of the physics, the algorithms, parallelization, and let proper CS majors do the hackish stuff.
« Last Edit: October 30, 2016, 01:14:46 PM by sdog »

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14945
  • Total likes: 334
  • Helpful: 146
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #38 on: October 30, 2016, 01:32:08 PM »
Does anyone program anything significant in D these days?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4502
  • Total likes: 151
  • Helpful: 105
  • Languages: EN, NO
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #39 on: October 30, 2016, 02:29:18 PM »
Often job adds did not seem entirely consistent. I wonder if they can get anyone on earth that fulfils all necessary requirements.

That is apparently common. These days, they probably ask for three year experience with Windows 10.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8656
  • Total likes: 283
  • Helpful: 226
  • Languages: De,EN,JP
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #40 on: October 30, 2016, 09:28:30 PM »
In Germany there is a lot demand (i.e. best pay) for real programmers, which means embedded C code for industrial applications. According to c't the highest paid IT professionals (after consulting ... ) the programmers for embedded devices, which were about 61 k€/year (was already one or two years ago). The lowest paid (apparently because everybody can do this) was web-programmer/layouter with (41 k€ about).

Even though object oriented programming is nice, in the end a lot of stuff in industry either uses ancient libraries (which are optimised for C) or every cent counts. A fried of mine supervises car multimedia programming for several high end German manufacturer, and then have to use hardware which will be still available for another 10 years and be as cheap as possible. That often means using ancient architectures or quite underpowered chips by todays standard.

Given that apparently many theoretic physics end up in the finacial "industry", where information is transferred via the www an application using a Java surrounding and just a number crunching core (which could be C or Fortran or anything decent performant) makes some sense.

Recently I had an interview for a Professorship in Switzerland (I consider myself also doing physics, but rather very applied). I always mention Simutrans in my applications, but at that time there was also an informatics professor in the commission and questions me about my involvement. I was quite surprise (never happened to me before on the three other occasions which also had someone from informatics in the commission). So while you were not deeply involved with programming, working and helping with Simutrans and its community might be still something you may want to add to your CV.
« Last Edit: October 30, 2016, 11:01:29 PM by prissi »

Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #41 on: October 30, 2016, 10:38:24 PM »
To add to what prissi said, such jobs can be quite attractive, since one has to deal with actual physical systems (eg cars, machinery) not just an abstract concept. The more big-corporate it gets, the more likely they ask for Java experience (for example SAP). When it comes to measurement and instrumentation there is a fair deal of python requested.*

I've missed an opportunity to apply to a job posting by a company at the very top of my wish-list as a python developer with completed studies in Physics, Maths, or CS (in that order, for the former two cases completed means PhD).


Unfortunately I never contributed to Simutrans. Lengthy effusions to discussion threads are not contributions. However, I did gain much from this community. While I have not played Simutrans in years (I cannot stop myself playing when I start it.) I still come back to this forum for the (i) company and (ii) learning.

(i) This is the most pleasant community I have seen on the net. As a metric to determine this I consider if there is anyone of the individuals I know I would rather not to visit and stay at my flat. Yet there is no one. To the contrary, I should be delighted to meet anyone.

(ii) I often learned interesting aspects from following dev discussions. Coming back to the topic, i've learnt more about C++, its memory management, library idiosyncrasies here than in any other context. What is more, over the years James' writing style has quite thoroughly influenced my own. He is so to say an involuntary English as a second language teacher.

prissi, all the best in those attempts to attain a professorship. Looking at the workload you manage in Simutrans beside your actual research and family obligations, I think it is a proof you can handle professorship with the back-breaking workload it comes with. It makes more than sense to mention it, besides being lead dev, it also shows that you have time you can make free by neglecting it.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3913
  • Total likes: 117
  • Helpful: 68
  • Minister of Silly Posts
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #42 on: October 30, 2016, 10:47:14 PM »
I commit the crime of thread necromancy to follow up a couple of years (...)

This really came back to bite me in the ****. (...)

It is to be seen if this indeed bites me in the ****. (...)
What the hell have you just summoned? A zombie?

See? That's what you get with thread necromancy, specially in October.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8656
  • Total likes: 283
  • Helpful: 226
  • Languages: De,EN,JP
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #43 on: October 30, 2016, 11:04:57 PM »
Actually I will start a professorship in Nagoya, Japan next January (some of the reasons I am have less and less time for Simutrans at the moment). So for me things have played out in the end, even if it was rather by accident.

Certainly life's way are rather convoluted. In another life I may have ended an embedded programmer like my friend, or maybe even as a SciFi writer. Just being open and curious does help (imho) at lot to cope with whatever life will throw at you; and a PhD in physics proves somehow that you are curious.

Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #44 on: October 31, 2016, 12:07:42 AM »
Congratulations prissi! This is fantastic news. [rm, too pers. for a pub. channel] It might seem unfortunate for Simutrans, but there is always a time where one has to grow up and leave the family home. This might apply for the Simutrans project as well.

I'm fine with all that comes. I've come to terms that I don't have the bite for a successful postdoc.* I am somewhat too disperse in my curiosity, which is indeed my most defining character trait. Some friends have, so they say, marvellous tasks in the industry. I have a couple of interesting things in mind. (Have to find out how to make a response to an application very likely.) What makes me enthusiastic in these jobs are that they require not only physics but are quite interdisciplinary and require physics.

*Having been able to contribute to research, and what is more, having made friends with other researchers, is so rewarding that even if everything that comes after were a complete disappointment, balanced at the very end it would be a life worth lived.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14945
  • Total likes: 334
  • Helpful: 146
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #45 on: October 31, 2016, 01:29:30 PM »
It is interesting that, as of January, Prissi will have lived and worked in the three countries in which Simutrans is most popular.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Isaac.Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3386
  • Total likes: 254
  • Helpful: 90
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #46 on: October 31, 2016, 10:53:07 PM »
It is interesting that, as of January, Prissi will have lived and worked in the three countries in which Simutrans is most popular.

Coincidence? Or conspiracy?

....well, coincidence, obviously, of course. :)

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1379
  • Total likes: 20
  • Helpful: 53
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #47 on: November 01, 2016, 10:29:41 AM »
Actually I will start a professorship in Nagoya, Japan next January  proves somehow that you are curious.

Congratulations, prissi, I hope it will work out for you and your family!
Bob Marley: No woman, no cry

Programmer: No user, no bugs



Offline el_slapper

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #48 on: November 02, 2016, 12:04:31 PM »
(.../...)Often job adds did not seem entirely consistent. I wonder if they can get anyone on earth that fulfils all necessary requirements.(.../...)

Often? Always you mean. As soon as the position is a little bit beyond the standard, demands are unrealistic. 3 years of XP with AngularJS2(out this year), expert in 15 other programming languages in all paradigms, masters all the automated test suites of the market, loves doing manual tests as well, is god in system(Windows AND Unix), is expert in the functional domain, and will be paid with peanuts.

That's the standard job ad, those days, in France, and probably everywhere else in the world. Of course, they hire who they find that more or less fits. I had no experience in systems, neither in the medical industry, when I was hired where I am now. It would have helped me, though..... but other candidates(all 25 of them) were even further from the ad.

Ah, and congrats for you, Prissi. Have fun over there.

Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #49 on: November 02, 2016, 03:02:39 PM »
Often? Always you mean. As soon as the position is a little bit beyond the standard, demands are unrealistic. 3 years of XP with AngularJS2(out this year), expert in 15 other programming languages in all paradigms, masters all the automated test suites of the market, loves doing manual tests as well, is god in system(Windows AND Unix), is expert in the functional domain, and will be paid with peanuts.
I've not seen something as extreme as that. Also not contradictory constraints. However, such that would restrict the number of people to a very small number indeed.


Another type of job adds is the hilarious one. In one case they had ten bullet points, emphasising that one can do excellent shopping nearby (centre of Cologne), that they have 'kicker' (aka 'foosball') matches and irrelevant stuff like that. Requirements: anyone who knows a bit of programming and has graduated from computer or natural sciences, or engineering. Not a single word about what they were doing. I wonder who they expect to get with such an add?

Quote
That's the standard job ad, those days, in France, and probably everywhere else in the world. Of course, they hire who they find that more or less fits. I had no experience in systems, neither in the medical industry, when I was hired where I am now. It would have helped me, though..... but other candidates(all 25 of them) were even further from the ad.

I've not considered applying when I did not meet the necessary constraints. It is interesting that you did so, and were accepted. How did you do that? Mention in the cover letter: "Although I do not fulfil the necessary requirement <fill in the blank> I can compensate this thorugh my experience with something very similar?"

If I were writing requirements, and i would get an offer by someone who would not fit, I would be a bit cross. After all they were wasting their and my time for a certain refusal. However, I should make sure that the requirements are indeed necessary. (I mean, it cannot be so difficult to differ between 'must haves' and 'nice to haves'?)

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2504
  • Total likes: 261
  • Helpful: 88
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #50 on: November 02, 2016, 03:47:30 PM »
I've not considered applying when I did not meet the necessary constraints. It is interesting that you did so, and were accepted. How did you do that? Mention in the cover letter: "Although I do not fulfil the necessary requirement <fill in the blank> I can compensate this thorugh my experience with something very similar?"

If I were writing requirements, and i would get an offer by someone who would not fit, I would be a bit cross. After all they were wasting their and my time for a certain refusal. However, I should make sure that the requirements are indeed necessary. (I mean, it cannot be so difficult to differ between 'must haves' and 'nice to haves'?)
You just need to apply to some of the requirements, not all. It works the same in Brazil, I've seen job ads requiring decades of experience in hundreds of areas while you should also be a recently graduated person and less than 30 years old. They will just choose the one that is closer.

I've even seen inconsistent ads, like one saying "First job" and then one of the requirements was "5 years experience". Or another saying "Looking for newly graduated students" and one of the requirements "Master's degree".

As I see it's like they removed the "optionals" part and made them all requirements. It's an HR thing, don't try to find logic on that.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4502
  • Total likes: 151
  • Helpful: 105
  • Languages: EN, NO
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #51 on: November 02, 2016, 05:05:29 PM »
And I doubt they will consider you crazy for applying without meeting all requirements, because quite a lot of those that apply for a job where I work don't meet any of the requirements. They don't have a chance, though. I don't remember what they were looking for when I applied for and got my current job, but I remember that during the interview, when asked if I had experience with something, I could at best answer that I had done a single assignment during my studies. In essence, the only thing that qualified me was that I knew a bit of Java and had gotten through five years of college/university. Being a bit outside the big city, nor among the highest paying employers in the country for my line of work, they might have been able to pick from the top shelf and I had been turned down by several others before (including other jobs that have the same relatively low wages), but they certainly don't appear to have regretted it. Everyone, even the expensive, experienced consultant developers we hire in "to get us through", need some tutoring before they can be productive. Being part of the government might mean that the pressure competition puts on private companies is less, though.

One thing is certain: if you don't apply, you will not get the job. Not that I recommend applying for work you don't feel comfortable with, unless you get desperate. At worst, you get called in for a pointless interview, but even that is a sign that they thought you were a promising candidate (unless they have a very odd selection process).

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3913
  • Total likes: 117
  • Helpful: 68
  • Minister of Silly Posts
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #52 on: November 02, 2016, 05:33:04 PM »
At worst, you get called in for a pointless interview, but even that is a sign that they thought you were a promising candidate (unless they have a very odd selection process).
Relevant:


Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #53 on: November 03, 2016, 08:06:24 PM »
Relevant:
[silly job interview video]
I can relate to this even more today. I've just been baffled looking at a German online job application questionnaire. They ask unashamedly for:

Gender, birthday and nationality!

With this I can only wonder if on the next page they ask for sexual orientation, political bias, and an effin [redacted].

A minor nuisance in comparison is that on top of that they expect to the applicant to come forward and propose monthly pay (ie. kneecapping themselves) It's not just that I've no idea if i can expect 2k or 5k a month (neither do I care if work is good), but it is them who put up the offer.


edited, since it was too drastic.
« Last Edit: November 03, 2016, 09:24:03 PM by sdog »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8656
  • Total likes: 283
  • Helpful: 226
  • Languages: De,EN,JP
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #54 on: November 03, 2016, 09:23:32 PM »
German CV requires also a photo.

And they ask for sex, birthday and nationality. Gender or sexual orientation does not matter. Honestly, at the interview the HR will know who turns up anyway. (I was baffled because the britons ask for nationality and race, with an option to decline to say, but still ... )

And even if you not give your birthday, the dates on your diploma/certificates are as telling. And nationality is a serious issue, as some positions (for instance on certain EU programs) are not allowed to filled with applicants from the home country. Or, in the UK, it might be next to impossible to get a working Visa for them.

And with a PhD, you are applying for a position that needs independent thinking. So you should know how much you work is worth. Do not be afraid to ask for something with 4000-5000€ a month (if the work is requiring a PhD related level though). They will very unlikely decline and will say this is unrealistic.

You know, you want them to hire you. It is their game (and while different in akademia and industry, and country) you have to play be their rules.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4502
  • Total likes: 151
  • Helpful: 105
  • Languages: EN, NO
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #55 on: November 03, 2016, 09:41:50 PM »
(This is much the same as prissi wrote. I just started writing this before he posted.)

I don't remember being asked what I expected/demanded to be paid in the application. That only came up during the interviews. The issue has to be settled at some point, so they might as well get it over with, I guess. I had no idea what to ask for myself, I was just happy to get started.

As for asking for nationality, that is actually important for some jobs, including my own. People of some nationalities can probably just forget about getting the required security clearance. As for gender and birth date, that might have been part of the standardized form used by a popular web recruitment software. I think I wrote both of them in the CV anyway, and possibly the application letter as well. Half the places I contacted would have been able to find out if they cared (hence the security clearance thing), my name is not at all ambiguous, and my history of education gives a good indication of my age anyway. Discrimination is also apparently based primarily on name in Norway. It doesn't matter if you've been born and raised in Norway, and got top grades from relevant Norwegian schools. If your name doesn't seem Norwegian, you go to the bottom of the pile, or at least far enough down to not get called in for an interview. There are stories of people getting jobs immediately after changing their names. Even if their looks still revealed their ethnicity at the interview, their personality overcame prejudice once they only got the opportunity to meet face-to-face.

Offline sdog

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #56 on: November 03, 2016, 09:49:29 PM »
I've seen in several forms that they asked whether one is allowed to work without any need for a permit. This is relevant information for an employer.

I've grown up in Germany and learned all that stuff. However, for crying out loud the anti discrimination laws have been passed 10 years ago! Yet nearly nothing has changed? (Well, at closer inspection the birthdate at least, it isn't marked with '* required'.)

In the end I am going to play by their rules. However, I'm going to feel dirty by risking positive discrimination. There are some things I shan't do for now, including birthdates and photos, since they cannot request it. I doubt that I would like to work for an employer who wouldn't take me for such reasons.

I've done quite a lot of job search and applications for family in Canada. Such things were handled quite a bit differently. While the discrimination stuff was done properly.* One advice in particular was to consider employers who asked for a salary request unprofessional (to say the least). With this there is no room for negotiations.

*They are not allowed to ask, applications that come with, eg, a photo have to be disregarded.)


ps.: I'm sorry for starting to rant here, and in particular as it is so off topic. But this was just too much, one more thing that made me wonder why on earth did I come back. Family went for holidays home in China and I needed any vent. Thanks for your reasonable feedback.


Discrimination is also apparently based primarily on name in Norway. It doesn't matter if you've been born and raised in Norway, and got top grades from relevant Norwegian schools. If your name doesn't seem Norwegian, you go to the bottom of the pile, or at least far enough down to not get called in for an interview. There are stories of people getting jobs immediately after changing their names. Even if their looks still revealed their ethnicity at the interview, their personality overcame prejudice once they only got the opportunity to meet face-to-face.

That appears to be the case throughout Europe. They were talking about moving application processes to an European standard for anonymous applications even before I left. But except for a couple of test cases nothing whatsoever happened.



@admins, mods
It just occured to me that this is in the open radomness lounge, not the devotee one. Some things might be perhaps better kept at that former place. In particular since I led this thread so astray. Good break points might be reply #32 (my necromancy), after #42, or #53 (where i started to rant only). As far as I can see only devotees participated. If you agree with a move, would you please do so?
« Last Edit: November 04, 2016, 05:53:33 PM by sdog »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4502
  • Total likes: 151
  • Helpful: 105
  • Languages: EN, NO
Re: Haskell (formerly: Languages, got to learn another one)
« Reply #57 on: November 04, 2016, 06:48:05 AM »
I don't think it's possible for someone to derail their own topic in the randomness lounge. The only purpose of moving it to the devotee lounge would be to keep things secret to the general public.

Well, at closer inspection the birthdate at least, it isn't marked with '* required'.

I wonder if that is even worse. An optional field adds an extra piece of information. How will they interpret someone's unwillingness to state their birthday?

Offline el_slapper

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #58 on: November 15, 2016, 01:30:16 PM »
Sorry for the late answer, had missed that one.

I've not seen something as extreme as that. Also not contradictory constraints. However, such that would restrict the number of people to a very small number indeed.

It's more a wishlist for the perfect candidate. All those skills are useful in my current job, so the list was no idiot. They just know in advance that noone will fit all bullet points. And I'm still rather weak in LINUX system. I made progress in knowledge of the medical industry.

That being said, yes, the position is extremely broad - programming, test scripting, manual testing, system. Most other candidates had only 1 or 2 of them, I did have 3.

Another type of job adds is the hilarious one. In one case they had ten bullet points, emphasising that one can do excellent shopping nearby (centre of Cologne), that they have 'kicker' (aka 'foosball') matches and irrelevant stuff like that. Requirements: anyone who knows a bit of programming and has graduated from computer or natural sciences, or engineering. Not a single word about what they were doing. I wonder who they expect to get with such an add?

I was once contacted by a head hunter for a similar job in Berlin, and the main points were "there is a billiard" and "we will teach you the basics of German"(I'm good in German, no more fluent as I once was, but lessons for beginners would be a pure waste of time for me).

I've not considered applying when I did not meet the necessary constraints. It is interesting that you did so, and were accepted. How did you do that? Mention in the cover letter: "Although I do not fulfil the necessary requirement <fill in the blank> I can compensate this thorugh my experience with something very similar?"

Well, I also knew personally my future boss - which helps making a proper answer a lot, even if the final decision was not his own, but the big boss's - but even without it, when I was a consultant, I often filled less than half of the bullet points when I won the mission. Only once out of 13 missions, I was "perfect". All 12 others, I had holes.

If I were writing requirements, and i would get an offer by someone who would not fit, I would be a bit cross. After all they were wasting their and my time for a certain refusal. However, I should make sure that the requirements are indeed necessary. (I mean, it cannot be so difficult to differ between 'must haves' and 'nice to haves'?)

Usually, noone on the market has all the "must have", and you learn them on the fly. I've got regular trainings on the parts I'm weak.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3913
  • Total likes: 117
  • Helpful: 68
  • Minister of Silly Posts
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Languages, got to learn another one.
« Reply #59 on: January 15, 2017, 09:01:42 PM »
Just got my aha moment with AutoLISP.

In 2011 (or 2009), I needed to create a function to find the n-position of an item in a list, something like find "c" in ("a" "b" "c" "d" "e" "f") and return 2, false if item does not belong. That's the monstrosity I coded back then:

Code: [Select]
(defun position    (elem lst / elem_check pos pos_found)

  ;; check if the element is member of the list
  (if (not (member elem lst))
    nil                    ; returns 'nil' if not member

    ;; proceed if member
    (progn
      (setq pos    0            ; set position to zero
        pos_found nil
      ) ;_ setq

      ;; check the list
      (while (and
           (setq elem_check (nth pos lst)) ; pick an element
           (null pos_found)        ; ... and check if position is not found
         ) ;_ and

        ;; check the element
        (if (/= elem_check elem)    ; if not found
          (setq pos (1+ pos))        ; then: go ahead to test the next one
          (setq pos_found pos)        ; else: found! record the position to stop the (while)
        ) ;_ if
      ) ;_ while

      pos_found                ; returns <pos> if member
    ) ;_ progn
  ) ;_ if
) ;_ defun

1st, I used to comment every fudging line. 2nd, it's huge and ugly.

Today a happy accident made me remind of that over 6-year-old code, that I should go "backwards" and rewrite it:

Code: [Select]
(defun position    (elem lst / rest)
  (if
    (setq rest (member elem (reverse lst)))
    (1- (length rest))
    nil
  )
)

Deus ex machina.

Offline yorkeiser

Re: Haskell (formerly: Languages, got to learn another one)
« Reply #60 on: January 16, 2017, 01:07:31 AM »
As a former programmer in many languages (c, java, c# and some others) i've to say: brrrrrr, lisp syntax is horrible