Thread: Scheme

Page 1 of 4 123 ... Last
  • Jump to page:
    #1
  1. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407

    Scheme


    In scheme, how do i know what i am missing a ( or when i have to add ( ), I am reading a few tutorials but i cant find were it mentions something about this. IE

    scheme Code:
    (define age 26)
     (set! age ( + age 1 ))
    (display age) (newline)
    or etc. I was getting an error at this snippet before because i was missing '( )' around + age.
  2. #2
  3. Arcane Scribbler
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2005
    Location
    Indianapolis, IN
    Posts
    1,907
    Rep Power
    584
    I haven't messed with Scheme, but I've messed with Lisp, and the only thing I found was to carefully write it in a text editor in a very expanded notation (using most of the parentheses like braces in a C-style language, and writing the closing as soon as I write the opening). Then I collapse it to a more conventional style.

    Other than that, the only thing I'm aware of that would help (unless there is a very good IDE somewhere that does brace matching, perhaps Emacs), is a very methodical use of the eyeballs and fingers.
    Joel B Fant
    "An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that."

    .NET Must-Haves
    Tools: Reflector
    References: Threading in .NET
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2002
    Posts
    596
    Rep Power
    23
    Originally Posted by xlordt
    In scheme, how do i know what i am missing a ( or when i have to add ( ), I am reading a few tutorials but i cant find were it mentions something about this. IE

    scheme Code:
    (define age 26)
     (set! age ( + age 1 ))
    (display age) (newline)
    or etc. I was getting an error at this snippet before because i was missing '( )' around + age.
    (First of all, I don't know scheme, but do know c.l. and the issues are the same.)

    It's a simple rule - you need an opening paren whenever you apply a function. (+ age 1) applies the + function to age and 1. This makes most issues about operator precedence etc disappear.

    your best defence is a good editor, such as emacs and scheme-mode which will not only highlight the opening/closing paren but insert a closing one for you when you type '(', so you never need to count them.
  6. #4
  7. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    jamieB: The editor would actually be a good idea, but... then again its not.. because i dont want to someday get stuck out with out that editor.. and still have the waited headaches, The point is that i dont want to get used to it.. but it is a good think to use at start.

    LyonHaert: I guess the eyeball and fingering would have to me used then but.... jamie sorta answered some of my doubts... for every function it needs an opening and closing '('. So ya.. the eyeball will have to be one of my selections
  8. #5
  9. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1050
    The editor is a very good idea. I find emacs a tad annoying though, so I'd go for scribes which is infinitely nicer. You're on slack though, so it'll be a pain in the arse to install.

    Scribes has a feature that AFAIK no other editor has, templates. No other editor does them with quite the power that scribes does It's no longer simple insert-on-click
  10. #6
  11. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    Originally Posted by LinuxPenguin
    The editor is a very good idea. I find emacs a tad annoying though, so I'd go for scribes which is infinitely nicer. You're on slack though, so it'll be a pain in the arse to install.

    Scribes has a feature that AFAIK no other editor has, templates. No other editor does them with quite the power that scribes does It's no longer simple insert-on-click
    Are you doubting my linux slackware skill's sissy!! we will see.. i will install it and post a snapshot.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2002
    Posts
    596
    Rep Power
    23
    Originally Posted by LinuxPenguin
    The editor is a very good idea. I find emacs a tad annoying though, so I'd go for scribes which is infinitely nicer.
    not wanting to start a war, but...if you take the time to learn emacs you will not regret it. It's streets ahead of any other editor I've come across, so much that it's silly to compare them most of the time. I learned it because of slime, the 2nd-to-none lisp environment/IDE, but I believe that scheme-mode also has auto-indentation, highlighting, code completion, execute current buffer etc etc. It is endlessly extensible (using elisp, which xlordt will appreciate if he's learning scheme), the key-bindings become second nature and are very productive to use. Every time you pick up a new language you can just find the emacs mode for it - there will be one and it may well be excellent. It's a software classic - not many pieces of software make it to version 21. The editor for discerning hackers!:-)
  14. #8
  15. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    I know a little about emacs.. im just a highlight color lover junkie
  16. #9
  17. Arcane Scribbler
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2005
    Location
    Indianapolis, IN
    Posts
    1,907
    Rep Power
    584
    jamieB: But if you end up working on different computers, you may not be able to take it with you (especially if you personally customize it). In such cases, it's more work to try and do that, it's a pain to switch back and forth, so in the end it's easier to stick with something that's going to be consistent across the workstations one uses.
    Joel B Fant
    "An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that."

    .NET Must-Haves
    Tools: Reflector
    References: Threading in .NET
  18. #10
  19. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1050
    JamieB>>not wanting to start a war, but...if you take the time to learn emacs you will not regret it.

    I took time to learn the basics and I don't find it any better than anything else. Oh, and it's irritating customising font etc.

    >>It's streets ahead of any other editor I've come across, so much that it's silly to compare them most of the time.

    Emacs doesn't have scribes templates

    >>I learned it because of slime, the 2nd-to-none lisp environment/IDE, but I believe that scheme-mode also has auto-indentation, highlighting, code completion, execute current buffer etc etc.

    Never got on with slime, seems like it tries to do too much and is an infinite pain to get going.

    >>It is endlessly extensible (using elisp, which xlordt will appreciate if he's learning scheme).

    Elisp is kack! Seriously, it's the worst lisp you could ever come up with. It tries to do too much automatic type conversion and there's no direct way to coerce it. Not impressive.

    >>the key-bindings become second nature and are very productive to use. Every time you pick up a new language you can just find the emacs mode for it - there will be one and it may well be excellent.

    Eventually I guess, if you can live with it's other faults. I still want templates.

    >>It's a software classic - not many pieces of software make it to version 21. The editor for discerning hackers!:-)

    Or rather other pieces of software fit more updates into their minor numbers...
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2002
    Posts
    596
    Rep Power
    23
    Originally Posted by LinuxPenguin
    Emacs doesn't have scribes templates
    From my 10 second skim through the scribes FAQ it seems that templates could easily be done in emacs by someone who needed that itch scratching. If you think it would this 'killer feature' would be hard to recreate you should look again at elisp (which I agree is not a model lisp). What if you want templates that work in a completely different way? How easy would that be to achieve with scribes? I don't include forking the (presumably) c++ code and ending up with your own version as an option.

    Originally Posted by LinuxPenguin
    >>It's a software classic - not many pieces of software make it to version 21. The editor for discerning hackers!:-)

    Or rather other pieces of software fit more updates into their minor numbers...
    Beg to differ. The first version of emacs was written in the early 70s (by rms), although the present incarnation began in the 80s.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2002
    Posts
    596
    Rep Power
    23
    Originally Posted by LyonHaert
    jamieB: But if you end up working on different computers, you may not be able to take it with you (especially if you personally customize it). In such cases, it's more work to try and do that, it's a pain to switch back and forth, so in the end it's easier to stick with something that's going to be consistent across the workstations one uses.
    it's true, you should know vi too for that reason.
  24. #13
  25. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1050
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2002
    Posts
    596
    Rep Power
    23
    Originally Posted by LinuxPenguin
    Could you please reply to the rest of my post, Jamie?
    Sure!
    Oh, and it's irritating customising font etc.
    I couldn't comment, I'm happy with the default faces and color-themes
    Never got on with slime, seems like it tries to do too much and is an infinite pain to get going.
    I've never had any problems installing slime and if you're using one of the open source common lisps it is the de facto standard. I like jumping to the hyperspec docs for the function under point etc. Have you seen Marco Baringer's slime movie? Worth a watch http://common-lisp.net/project/slime/doc/slime.torrent

    >>It is endlessly extensible (using elisp, which xlordt will appreciate if he's learning scheme).

    Elisp is kack! Seriously, it's the worst lisp you could ever come up with. It tries to do too much automatic type conversion and there's no direct way to coerce it. Not impressive.
    I agree, it's not a general purpose language and typing has gotchas compared to strongly typed (but dynamic) modern lisps, but I think it makes a good embedded scripting language. The rich API helps - if you want to create a function that moves text around, rewrites as you type (eg closing parens or something more complicated) it's a matter of calling existing hooks.
  28. #15
  29. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    Ok, i got the editor installed.. now i just need to change its BG from white to black.. it was as simple as python2.4 setup.py install.... done!
Page 1 of 4 123 ... Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo