Arc Forumnew | comments | leaders | submit | cchooper's commentslogin

C#

That's how I pay the bills.

-----

2 points by lojic 6404 days ago | link

Sorry for the omission :) I did a couple years of C# development back on 2002, but for some reason the whole .NET area slipped my mind. I added C#, but I'll wait to add Visual Basic until someone has the courage to suggest it :)

-----

6 points by cchooper 6404 days ago | link

I used to do VB, but now we've completely switched to C#. Why? Because no one wanted it on their CV.

Seriously, that was the reason.

-----

3 points by treef 6404 days ago | link

should i remove it form my resume?

-----

8 points by cchooper 6404 days ago | link

To be honest, I quite like VB. Maybe it's because my first language was BBC BASIC. Ah, those were the days...

  10 PRINT "*"
  20 GOTO 10
When you're 6 years old, that's the most exciting program in the world.

-----

4 points by sacado 6403 days ago | link

Ah, I remember that too. Those innocent days where most of the problems were like "should I use 'print' or 'input' there ? What's the difference between them ?"

-----

3 points by prime2 6403 days ago | link

Yes, I have removed that and am considering playing down how long I did PHP.

-----

4 points by cchooper 6404 days ago | link | parent | on: Symbols with "/" and file manipulation

w/ is a convention, short for 'with'.

If you're looking for Arc documentation, then try http://practical-scheme.net/wiliki/arcxref

In particular, the kind of commands you're looking for are:

w/infile (open a file for input, execute some code, and then close it)

w/outfile (same as w/infile but for output)

readc/readb (read a character/byte from an open file)

writec/writeb (write a character/byte to an open file)

Other useful operators are readfile, writefile, drain and w/stdout. Note that most of the Arc functions related to file manipulation assume that the file you're editing is Arc code (e.g. readfile) so watch out for that. I haven't yet found an easy way to read the contents of a file into a string, but the following function works:

  (def loadtext (filename)
    (apply string (w/infile s filename (drain (readc s)))))

-----

2 points by cchooper 6404 days ago | link

Your question has inspired me to do some coding, so I've just posted this to the forum:

http://arclanguage.org/item?id=4220

-----

1 point by cchooper 6404 days ago | link | parent | on: Issues Regarding Lisp Adoption

Speaking of eclipse plug-ins, someone just posted this to another article:

http://arclanguage.org/item?id=4148

-----

10 points by cchooper 6404 days ago | link | parent | on: Issues Regarding Lisp Adoption

In the future, everyone will use Lisp, but they won't know it's Lisp, because it will be called Microsoft Windows Dynamic Service-Oriented Parenthesis Construction Language for .NET.

-----

6 points by kennytilton 6404 days ago | link

heh-heh, no, we had our chance:

http://www.international-lisp-conference.org/2005/speakers.h...

Mr Dussud (a respected Lisper in a former life) said MS would be happy to host a Lisp if we would just add strong static typing and lose our silly little OO package, CLOS. A couple of other things, too.

We almost ran him from the room. :)

Meanwhile, there is: http://dotlisp.sourceforge.net/dotlisp.htm

....though the name is not as good as yours.

-----

1 point by cchooper 6404 days ago | link

I've just looked at the slides. Did he seriously call Java a dynamic language?

-----

8 points by kennytilton 6404 days ago | link

"Did he seriously call Java a dynamic language?"

Wow, yeah. I tuned him out when I saw he wanted us to declare our variable types. I did not listen to all of the audio, but in there somewhere you will hear some nutjob asking if, given that Lisp has finally started taking over the landscape and he now wants us to run up the white flag and adopt static typing, he also thinks it is time for mainland China surrender to Taiwan. That was me.

I went up later and shook his hand for being brave enough to come into the lion's den. Strong guy. <ouch>

-----

6 points by lojic 6403 days ago | link

Yeah, he called Ruby an untyped scripting language. Strange that it gives the following TypeError then ;)

  irb(main):003:0> x + 7
  TypeError: can't convert Fixnum into String
          from (irb):3:in `+'
          from (irb):3

-----

8 points by cchooper 6404 days ago | link | parent | on: Issues Regarding Lisp Adoption

One thing that's helped Rails adoption a lot is that you can get the whole thing up and running in 3 steps: install Ruby, install Gems, get Rails. All of this is available from one page on the Rails site, so it's really easy to try it out. You don't even need a web server; they provide one for you.

Lisp in a Box is the closest thing Lisp has to this, but can anyone seriously say that asking people to learn Lisp, Emacs and SLIME at the same time is the way to get people hooked on the language?

I think what Lisp actually needs is a nice, easy install package: Scheme/Lisp, a nice HTML help/tutorial system and a simple editor, like the one that comes with Ruby (basically Notepad with syntax highlighting and top-level integration <-- this is the key feature). Perhaps you could throw in some kind of web-app package that people can start playing with (just like the one in Arc) and a package system (one as easy to use as Gems would be nice). All of this should be wrapped up in a single installer.

This way, people have a nice, gentle introduction to the language through a simple but expedient system, and can graduate to Emacs/Vi/Eclipse at their leisure.

Oh, and big, colourful, idiot-proof websites with the instructions on them are a big draw too.

-----

2 points by cchooper 6406 days ago | link | parent | on: Does Arc allow cyclic lists?

I doubt pg would want to ban them, and I also doubt he's given much thought to printing them, so I guess that's your answer.

-----


It would mean the former. I think that's the only sensible way to do it.

-----


That also looks useful to me, but to be pedantic, I wouldn't call it currying.

-----

4 points by cchooper 6406 days ago | link

Do you mean something like this?

  (mac fix rest
    (withs (rest-parm (if (is '_ (last rest)) (uniq))
            parms rest-parm
            body nil
            rev-rest (if rest-parm (cdr (rev rest)) (rev rest)))
           (trav rev-rest 
                 (fn (x) (if (is '_ (car x))
                             (w/uniq u (push u parms) (push u body))
                             (push (car x) body)))
                 [self (cdr _)])
           `(fn ,parms ,(if rest-parm 
                            (join (list 'apply) body (list rest-parm))
                            body))))
If so I'm going to push it to the wiki.

-----

1 point by tokipin 6406 days ago | link

actually i don't understand any of that ^_^;; i'm a lisp noob. in other languages there aren't macros so i implement it as a function which stores the function-to-be-curried and its initial arguments in a closure

however i tested your macro with some arithmetic and it all seems to work fine. the only thing i found is that something like this will cause an error:

  ((fix + _ 2) 3 4)
because there isn't an underscore at the end. i don't understand lisp enough to see if that was your intention. i think for the sake of variadic functions it should adapt regardless of where the underscore is (or whether or not it's present, eg: (fix +)), either by detecting if a function is variadic (which i'm guessing isn't reasonably possible at the moment) or by always returning a variadic function [edit: actually i think i can decipher the meaning of (if (is '_ (last rest))]

if the generated expression is always variadic, it would seem to mess with the fact that the underlying system cares how many arguments there are. is that a big deal? i don't think so. a language i use this function in is Lua, whose functions are all variadic (in that the interpreter doesn't complain if you supply too few (unsupplied are niled) or too many (excess are discarded) arguments) and it simply is never a problem. to me the fixed-argument thing seems similar in spirit to static typing in that it tries to solve a problem that really isn't significant

-----

2 points by cchooper 6406 days ago | link

Yes, I implemented it so it would only be variadic if there was an underscore at the end. It would actually be a simpler macro if they were always variadic, but that's such a radical change to the language that I'm a bit wary about it.

But maybe it's a good idea. I see your point about the 'spirit of static typing'. I'll have to check out Lua and see how it works out.

Edit: I mean it would be radical if fix were implicit, of course.

-----


Genius

-----

2 points by cchooper 6407 days ago | link | parent | on: could currying be introduced in Arc?

I've already come across multiple scenarios where automatic currying would have shortened my programs, and if the swap operator had been available, I'd have used it even more.

But I'm still not a fan of implicit currying. I think the behaviour would be too unpredicatable when mixing rest functions, optional arguments, apply and code generation together (for example, it's often useful to be able to pass 0 arguments to + when you are generating code, even if you'd never write that sort of thing manually).

My compromise: perhaps the [...] syntax could be adapted to do automatic currying. If you use _ then it has its normal behaviour, but if you don't then the function is curried automatically. Only required arguments can be passed to such a function, optional and rest arguments are ignored, so [+] simply evaluates to 0 (or a function that takes no arguments and returns 0).

-----

3 points by almkglor 6407 days ago | link

By this I think you mean:

  [foo bar] => (fn rest (apply foo bar rest))
...?

-----

2 points by cchooper 6407 days ago | link

I'd originally envisioned that the function returned would be more strongly typed (ie. it would expand to (fn (x y z) ...) if foo takes 4 arguments) and that the function would be truly curried, so ([foo bar] baz) would also be a curried function if foo requires more arguments.

Now I think about it, the solution you've given would be perfectly adequate. The function will still fail on the wrong number of arguments, and I almost never need the other feature at all. It would also play friendly with optional and rest arguments.

-----

1 point by almkglor 6407 days ago | link

Hmm. It would be possible to modify 'make-br-fn on the arc-wiki.git for this.

-----

More