Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Language Ideas

Name: Anonymous 2009-10-04 20:40

do you guys ever have ideas for features in programming languages that you have never seen implemented but would like to?
i'm sure some of you have. i can't be the only one.
share them here.
i'll start with an idea i had a little while ago; i wouldn't be surprised if some language such as perl had already thought of it though.

have you ever been stuck writing long if statements along the lines of: if(c == x || c == y || c == z)?
sure, it might not look so bad in this case since it's rather short. but what if you could abbreviate it?
something like: if(c == ||(x,y,z)), or perhaps if(c == (x || y || z)), or even if((x,y,z)||==(a,b,c)), which would expand to if(x == a || y == b || z == c).
wouldn't that be a nice little time saver?

Name: Anonymous 2009-10-06 15:28

>>40
I was talking about Python there, but which Lisp editors are you referring to?

Name: Anonymous 2009-10-06 15:35

>>38
They can, but it's painful.

Name: Anonymous 2009-10-06 15:56

>>37
I copied that line straight from the www.Wikipedia.org world wide web sight.

Since I, unlike some people, visit /b/ approximately one and a half times per year, and, unlike some people, do not feel insecure at the thought that some people might think otherwise, and, finally, since I barely registered this reference to a so-called «Meme», I had not felt a slightest desire to alter the number.

Name: Anonymous 2009-10-06 16:10

>>41
All of them, I'd think. Slime, the Lispworks IDE, ABLE... I obviously don't need to mess with any of them but Slime.

Name: Anonymous 2009-10-06 18:15

>>44
drscheme

Name: Anonymous 2009-10-06 18:55

>>44
Hmm, M-x slime-edit-definition seems to be roughly what I'm after. Does it require me to stop and restart the interpreter? or can I immediately start working with the new definitions?
>>45
DrScheme is what I've been using (or occasionally running and inferior scheme with quack-mode) and it's explicit stop-and-run is no better that having to use reload in python although it is more convenient.

Name: Anonymous 2009-10-06 23:37

>>46
DrScheme is what I've been using and it's explicit stop-and-run is no better that having to use reload in python although it is more convenient.
? You don't have to type in the definitions area. Just ctrl+d and the repl loop is yours to do with as you please, including save. Save interactions as...

Name: Anonymous 2009-10-07 4:30

>>47
I hadn't noticed that feature, but it just saves all the interactions(much like bpython or idle would for python) and misses the point of my original rant. Which is, "Why should I have to write a separate script to process my interactions, when my interpreter has all the bindings information built in?"

Name: Anonymous 2009-10-07 5:29

>>48
Enjoy your expanded macros.

Name: Anonymous 2009-10-07 10:47

>>46
interpreter
Lol.

More likely you're looking for slime-compile-defun (C-c C-c). M-. — slime-edit-definition — is useful, but it's more of a cross-referencing tool. You just put the cursor on a top-level form and press C-c C-c, and your new code is compiled and ready to go. It's not exactly a REPL dump, but I'd rather type my code in a file to begin with so I can organize it.

Name: Anonymous 2009-10-07 11:12

>>50
It's not that I don't separate my code into files, but it's not unusual for me to just spend a lot of time just tweaking things and then having to copy+paste code from my REPL and I would rather my tools took care of this than having to keep interrupting my workflow. Thanks though, I'll need to investigate SLIME further.

Name: Anonymous 2009-10-07 21:14

>>51
Right, that's what I thought you wanted. Most tools, you can just C-c C-c a definition (or whatever key) and it's sent straight to the Lisp, no cut/paste bullshit. Use a file for a scratch area instead of the REPL, and you're good to go.

Name: Anonymous 2009-10-07 21:19

Who the hell programs in an REPL loop?

Name: Anonymous 2009-10-07 21:30

>>53
Read Eval Print Loop loop
Loop loop loop? Loop loop loop.

Name: Anonymous 2009-10-07 21:58

>>54
you have been loop'd

Name: Anonymous 2009-10-07 22:27

>>55
You loop me right round, baby, right round.  Like a REPL loop, right round right round.

Name: Anonymous 2009-10-08 3:35

>>35
hey, that's actually pretty cool.
fuckyeah, COBOL

Name: Anonymous 2009-10-08 3:40

>>30
I see that someone needs to read their K&R again.

Name: Anonymous 2009-10-08 4:07

Perl now supports this using the Swiss army knife operator (~~).

Name: Anonymous 2009-10-08 5:09

Name: Anonymous 2009-10-08 5:21

>>50-53
I write most of my code in a file, and send it to the REPL using the appropirate SLIME commands. I switch to the REPL when I want to test functionality of newly written code or write any throw-away code.

Name: Anonymous 2009-10-08 18:59

>>61
But that is how Haskells do it. Haskells are not a real programmer !!

Name: Anonymous 2009-10-08 19:01

>>62
s/haskell/Lisp/ig;

Name: Anonymous 2009-10-08 19:09

The REPL is there for newcomers to learn the language.  If you are programming in the REPL, you are a fucking idiot and should feel kind of bad about it :(

Name: Anonymous 2009-10-08 19:21

>>64
2.5/10

Name: Anonymous 2009-10-08 19:25

>>65
Don't feel bad, I'm sure there's a handful of people that do it.

Name: Anonymous 2009-10-08 19:47

>>62
I can and do use whole project(just load up and compile the ASDF system) compilation when starting up my image. I compile individual definitions or run them as required, this is smarter and faster than just reloading and recompiling everything.
>>64
Programming, no. Testing/experimenting throw-away code, yes.
There is no reason to write code at the REPL that you're going to throw away. Some people may prefer copying REPL transcripts to a file, but I find it too messy for my own tastes.

In most implementations, you interact with the live image  through the REPL, even if you don't realize it. Even if all you do is a couple of COMPILE/LOAD/COMPILE-FILE (SLIME and/or ASDF will do it for you transparently). In the end it doesn't really matter, if you have a better way to interact with your image, you just do it.

Name: Anonymous 2010-12-10 9:46

Name: Anonymous 2010-12-27 17:45

Name: Anonymous 2011-02-04 18:04


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List