Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Notorious b.s.d.
Jan 25, 2003

by Reene
i will also admit i like hemlock, the editor

unfortunately it's not useful for very much because it just doesn't have the emacs ecosystem. at any given time, if you boot up hemlock, you are probably the only user on the planet

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

FamDav posted:

last time I tried to get evil mode working in emacs it took like an hour because I couldn't find a single tutorial on emacs that actually just force fed you the primitives instead of expecting me to know every key command as a prereq.

did you try the tutorial that was right in front of you built into emacs?

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Soricidus posted:

did you try the tutorial that was right in front of you built into emacs?

it took me a really long time to believe that anything supplied with a piece of software could possibly be useful to read, but emacs really does take that "self-documenting" thing seriously

Notorious b.s.d.
Jan 25, 2003

by Reene
hypertext and documentation are two of the ways that emacs really does live up to the lisp workstations of yore

that poo poo is no joke

emacs is also the only good way to browse gnu info pages. all the man pages for gnu tools were written by debian or red hat and are seriously abbreviated. if you want to know the details for e.g. gnu tar, break out emacs and browse the info pages.

oh no blimp issue
Feb 23, 2011

haskell!
why does "cheapest m t = map (cost m) t" gimme a:
Couldn't match type `Double' with `Int'
Expected type: [Int] -> Int
Actual type: [Int] -> Double
In the first argument of `map', namely `(cost m)'

it feels like it should work to me
im trying to map (cost m) over t and that should work surely?

t is a [[Int]], and i assumed itd just pass each [Int] to (cost m)

oh no blimp issue
Feb 23, 2011

the signature of cost is cost :: [[Double]] -> [Int] -> Double

oh no blimp issue
Feb 23, 2011

actually, duh, im an idiot

gonadic io
Feb 16, 2011

>>=
does cheapest have the sig-

Awia posted:

actually, duh, im an idiot

oh never mind

oh no blimp issue
Feb 23, 2011

gonadic io posted:

does cheapest have the sig-


oh never mind

yeah, my sig expected a [Int] not a Double like i was outputting

oh no blimp issue
Feb 23, 2011

the trouble now is i just get the cost of the journey not the actual journey

oh no blimp issue
Feb 23, 2011

that there exists a difference between Integer and Int in haskell will never cease to annoy me
how do i declare a list and make it one specific data type?
like i have "journey = [1,2,3]" atm but it thinks its a load of Integers not Ints

Su-Su-Sudoko
Oct 25, 2007

what stands in the way becomes the way

Awia posted:

that there exists a difference between Integer and Int in haskell will never cease to annoy me
how do i declare a list and make it one specific data type?
like i have "journey = [1,2,3]" atm but it thinks its a load of Integers not Ints

journey = [1,2,3] :: [Int]

(i think)

Valeyard
Mar 30, 2012


Grimey Drawer

Awia posted:

that there exists a difference between Integer and Int in haskell will never cease to annoy me
how do i declare a list and make it one specific data type?
like i have "journey = [1,2,3]" atm but it thinks its a load of Integers not Ints

journey = [1,2,3]::[Int]
journey::[Int] = [1,2,3]

one of them has to be right

gonadic io
Feb 16, 2011

>>=

Testiclops posted:

journey = [1,2,3] :: [Int]

(i think)
yes

Valeyard posted:

journey = [1,2,3]::[Int]
yes

Valeyard posted:

journey::[Int] = [1,2,3]
no, if you want to do this you need
journey :: [Int]
journey = [1,2,3]

this has the advantage of letting you do

journey = undefined

at the beginning while you're still working out the structure of your program which i find immensely useful

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Valeyard posted:

journey = [1,2,3]::[Int]
journey::[Int] = [1,2,3]

one of them has to be right

:shobon:

oh no blimp issue
Feb 23, 2011

Testiclops posted:

journey = [1,2,3] :: [Int]

(i think)

this was the one
i am not good at haskell

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Awia posted:

that there exists a difference between Integer and Int in haskell will never cease to annoy me
how do i declare a list and make it one specific data type?
like i have "journey = [1,2,3]" atm but it thinks its a load of Integers not Ints

haskell has a bunch of signed and unsigned integer types of different sizes, and integer is basically a bignum

gonadic io
Feb 16, 2011

>>=

Awia posted:

that there exists a difference between Integer and Int in haskell will never cease to annoy me
how do i declare a list and make it one specific data type?
like i have "journey = [1,2,3]" atm but it thinks its a load of Integers not Ints

Int is machine dependant, minimum 30 bits. Integer is arbitrary sized, usually called bigints in other langs. usually type inference will make sure that literals are the right type automatically, it's interesting that it doesn't in this case. most library functions work with Ints because they're quite a bit faster and more portable, not to mention traditional. most of these library functions have a version where you prepend `generic' (i.e. genericTake, genericLength) which aren't specialised to Ints but can return any of the integer types.

gonadic io
Feb 16, 2011

>>=
if you enable -XScopedTypeVariables you can do

x :: [Int] = [1,2,3]

but you should not do this unless you know you need to. you don't Awia.

it is pretty handy for type-driven programming though, like this guy: https://www.youtube.com/watch?v=52VsgyexS8Q

Luigi Thirty
Apr 30, 2006

Emergency confection port.

that's neat. given a card number indexed between 0 and 51 i don't need 40 lines of ifs and switches to get the "correct" name for the card number, i can just mod 13 and look it up right in the format function

code:
(defparameter *card-name-format* "~[Ace~;2~;3~;4~;5~;6~;7~;8~;9~;10~;Jack~;Queen~;King~] of ~a")

(defun get-card-name (card)
  (format nil *card-name-format* (mod card 13) (get-suit card)))

Luigi Thirty fucked around with this message at 20:17 on May 3, 2015

Bloody
Mar 3, 2013

that's an ugly rear end lookup table you got there

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Bloody posted:

that's an ugly rear end lookup table you got there

i'm on chapter 4 and googling "doing x but in lisp"

leftist heap
Feb 28, 2013

Fun Shoe
lol, that's one way to do it i guess

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
someone should write a modal terminal-oriented full-screen editor in Haskell where all of the editing commands are purely functional and directly correlate to operations on the Buffer monad.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

eschaton posted:

someone should write a modal terminal-oriented full-screen editor in Haskell where all of the editing commands are purely functional and directly correlate to operations on the Buffer monad.

and call it chipotle

gonadic io
Feb 16, 2011

>>=

eschaton posted:

someone should write a modal terminal-oriented full-screen editor in Haskell where all of the editing commands are purely functional and directly correlate to operations on the Buffer monad.

This might be of interest to you: Stongly Typed Ghci Commands

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
here's a text editor for you to enjoy

http://acme.cat-v.org/

https://www.youtube.com/watch?v=dP1xVpMPn8M

Valeyard
Mar 30, 2012


Grimey Drawer
reminds me of when I accidently open stuff up with midnight commander, and then laugh at the name

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i dont really know how you would accidentally use midnight commander. but i use it for all my file browser needs because it's much better than the osx finder, which is still the worst part of osx

Valeyard
Mar 30, 2012


Grimey Drawer
on the linux distro i use, scientific linux, its part of the default right click context menu :negative:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i am really really excited that i get to go back to using linux as my operating system so that i can use xmonad again

PleasureKevin
Jan 2, 2011

i was on itch.io and i thought the games were fun and neat so i downloaded unity

and i heard you could use javascript with unity so that would be sweet.

so anyway then i read you had to to use semi-colons a lot and i was like i'm out

then i loaded up unity cause it was done downloading and wow it looks like photoshop from 2005 it's ugly as hell

close call i almost became a game developer

JewKiller 3000
Nov 28, 2006

by Lowtax

PleasureKevin posted:

i heard you could use javascript with ... so that would be sweet.

no don't

PleasureKevin
Jan 2, 2011

it's weird i used to hate javascript but now i just don't want to learn anything else so "love" it

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
javascript starts to seem sane if you use ruby for long enough

Valeyard
Mar 30, 2012


Grimey Drawer
i love jquery

JewKiller 3000
Nov 28, 2006

by Lowtax
suck it off

PleasureKevin
Jan 2, 2011

Valeyard posted:

i love jquery

it's pretty good. i don't like to use it anymore. but a lot[who?] of javascript people like despise it. and codecademy.com says teaching jquery before javascript is fine but everyone on stack overflow disagrees.

anyway, i personally learned jquery first and it introduced me to the whole syntax and all that but with 90% less words and effort, so that's great. then javascript was way easier.

anyway bye

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

PleasureKevin posted:

it's weird i used to hate javascript but now i just don't want to learn anything else so "love" it

this has been posed as the reason that js has been put in so many stupid places, so glad to see the basis in reality

Adbot
ADBOT LOVES YOU

brap
Aug 23, 2004

Grimey Drawer
learning the raw DOM for all the major browsers is a complete waste of time. use jQuery or something similar.

  • Locked thread